Skip to content

feat: add vite_shell crate for bash script parsing#18

Merged
wan9chi merged 4 commits into
mainfrom
vite_shell_split
Nov 6, 2025
Merged

feat: add vite_shell crate for bash script parsing#18
wan9chi merged 4 commits into
mainfrom
vite_shell_split

Conversation

@wan9chi

@wan9chi wan9chi commented Nov 6, 2025

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>

wan9chi commented Nov 6, 2025

Copy link
Copy Markdown
Member Author

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

@wan9chi
wan9chi marked this pull request as ready for review November 6, 2025 08:44
@wan9chi
wan9chi 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