Skip to content

feat: add vite_shell crate for bash script parsing#18

Merged
branchseer merged 4 commits intomainfrom
vite_shell_split
Nov 6, 2025
Merged

feat: add vite_shell crate for bash script parsing#18
branchseer merged 4 commits intomainfrom
vite_shell_split

Conversation

@branchseer
Copy link
Copy Markdown
Member

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

Co-Authored-By: Claude noreply@anthropic.com

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>
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer marked this pull request as ready for review November 6, 2025 08:44
@branchseer branchseer merged commit 79359e1 into main Nov 6, 2025
6 checks passed
@Brooooooklyn Brooooooklyn deleted the vite_shell_split branch December 11, 2025 06:40
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.

1 participant