fix(builtins): resolve 10 eval-surfaced interpreter bugs#216
Merged
Conversation
Fix 7 bugs and unignore 10 previously-skipped spec tests: - tail: support `tail -n +N` (start from line N) syntax - tr: implement POSIX character classes ([:lower:], [:upper:], etc.) - grep: add BRE mode — literal ( ) are escaped, \( \) become groups - sed: proper BRE-to-ERE conversion for patterns with literal parens - awk: implement match() 3rd-arg capture array (gawk extension) - interpreter: execute VFS scripts by path after chmod +x Tests fixed: tr_class_upper_from_pipe, while_read_pipe_vars, tail_plus_n_offset, script_chmod_exec_by_path, grep_bre_literal_paren, grep_bre_literal_paren_pattern, awk_field_multiply_accumulate, awk_match_capture_array, sed_capture_group_complex_bre, sed_ere_capture_group_extract Skipped test count: 87 → 77 https://claude.ai/code/session_016XS5TJwtYPBB7ao42BTFNx
c0d3b4e to
01e16d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
()are now correctly distinguished from group metacharacters\(\)chmod +xChanges
tail -n +Nreturns wrong lines+Nprefix, addtake_from_line()headtail.rstr '[:lower:]' '[:upper:]'garbledcuttr.rsgrep 'feat('crashes (unclosed group)bre_to_ere()conversion in default modegrep.rssedBRE capture groups fail with literal()bre_to_ere()conversion for BRE patternssed.rsawk match($0, /re/, arr)produces no outputawk.rs/tmp/script.shafterchmod +x→ command not foundmod.rsawk '{total += $2 * $3}'wrong resultwhile readin pipe empty varssed -EERE capture groupsSkipped test count: 87 → 77 (bash comparison: 488 → 492 matching real bash)
Test plan
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-features— all pass