Skip to content

fix(lexer): handle backslash-escaped metacharacters#230

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 23, 2026
Merged

fix(lexer): handle backslash-escaped metacharacters#230
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 23, 2026

Summary

  • Fix lexer to perform quote removal on backslash-escaped characters outside quotes
  • \< and \> now correctly produce literal < and > tokens, enabling string comparison in [ test commands
  • Removes 3 skip markers from spec tests (test_string_lt, test_string_gt, neg_string_compare_equal)

Test plan

  • Existing spec tests for test_string_lt, test_string_gt, neg_string_compare_equal now pass
  • Full test suite passes (cargo test --all-features)
  • cargo clippy clean
  • cargo fmt clean

Backslash outside quotes is a quoting mechanism in bash: \< means
literal <. The lexer now strips the backslash and emits only the
escaped character, enabling [ "a" \< "b" ] string comparisons.

Removes 3 skip markers from spec tests (test_string_lt, test_string_gt,
neg_string_compare_equal).
@chaliy chaliy merged commit 2bcf198 into main Feb 23, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants