Commit 79359e1
feat: add vite_shell crate for bash script parsing (#18)
Create a new vite_shell crate that uses ast-grep to parse and split
bash scripts by top-level && operators. The implementation properly
handles operator precedence and mixed operators (|| and &&).
Key features:
- Splits bash scripts by top-level && operators only
- Preserves nested structures (subshells, functions, etc.)
- Correctly handles || operators (left-associative precedence)
- Comprehensive test coverage (12 tests) including edge cases
Examples:
- "a && b && c" → ["a", "b", "c"]
- "a || b && c" → ["a || b", "c"]
- "a && b || c" → ["a && b || c"]
Dependencies:
- ast-grep-core 0.32.2 for AST-based parsing
- tree-sitter-bash 0.23.1 for bash grammar
- thiserror for error handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>4 files changed
+424
-0
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments