Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crates/bashkit/src/parser/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,21 @@ impl<'a> Lexer<'a> {
}
}
}
} else if ch == '\\' {
self.advance();
if let Some(next) = self.peek_char() {
if next == '\n' {
// Line continuation: skip backslash + newline
self.advance();
} else {
// Escaped character: backslash quotes the next char
// (quote removal — only the literal char survives)
word.push(next);
self.advance();
}
} else {
word.push('\\');
}
} else if self.is_word_char(ch) {
word.push(ch);
self.advance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ echo $((0 || 0))
### end

### neg_string_compare_equal
### skip: test string comparison with \< not fully implemented
# Equal strings not less/greater
[ "abc" \< "abc" ] && echo "less" || echo "not less"
### expect
Expand Down
2 changes: 0 additions & 2 deletions crates/bashkit/tests/spec_cases/bash/test-operators.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ empty
### end

### test_string_lt
### skip: test string comparison with \< not fully implemented
# String less than comparison
[ "apple" \< "banana" ] && echo "less"
### expect
less
### end

### test_string_gt
### skip: test string comparison with \> not fully implemented
# String greater than comparison
[ "zoo" \> "apple" ] && echo "greater"
### expect
Expand Down
6 changes: 3 additions & 3 deletions specs/009-implementation-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Bashkit implements IEEE 1003.1-2024 Shell Command Language. See

## Spec Test Coverage

**Total spec test cases:** 1043
**Total spec test cases:** 1043 (951 pass, 92 skip)

| Category | Cases | In CI | Pass | Skip | Notes |
|----------|-------|-------|------|------|-------|
Expand Down Expand Up @@ -144,7 +144,7 @@ Bashkit implements IEEE 1003.1-2024 Shell Command Language. See
| headtail.test.sh | 14 | |
| herestring.test.sh | 8 | 1 skipped |
| hextools.test.sh | 5 | od/xxd/hexdump (3 skipped) |
| negative-tests.test.sh | 16 | error conditions (4 skipped) |
| negative-tests.test.sh | 16 | error conditions (3 skipped) |
| nl.test.sh | 14 | line numbering |
| paste.test.sh | 4 | line merging (2 skipped) |
| path.test.sh | 14 | |
Expand All @@ -154,7 +154,7 @@ Bashkit implements IEEE 1003.1-2024 Shell Command Language. See
| sleep.test.sh | 6 | |
| sortuniq.test.sh | 32 | sort and uniq (2 skipped) |
| source.test.sh | 21 | source/., function loading, PATH search, positional params |
| test-operators.test.sh | 17 | file/string tests (2 skipped) |
| test-operators.test.sh | 17 | file/string tests |
| time.test.sh | 11 | Wall-clock only (user/sys always 0) |
| timeout.test.sh | 17 | |
| variables.test.sh | 44 | includes special vars, prefix env assignments |
Expand Down
Loading