Skip to content

Feat/migrate to prism#5

Merged
7a6163 merged 4 commits intomainfrom
feat/migrate-to-prism
Mar 16, 2026
Merged

Feat/migrate to prism#5
7a6163 merged 4 commits intomainfrom
feat/migrate-to-prism

Conversation

@7a6163
Copy link
Copy Markdown
Owner

@7a6163 7a6163 commented Mar 16, 2026

No description provided.

7a6163 added 4 commits March 16, 2026 16:16
Replace lib-ruby-parser (Ruby 3.1.2) with ruby-prism (Ruby 3.3+), the
official Ruby parser with Rust bindings. This brings:

- Support for Ruby 3.2, 3.3, 3.4+ syntax
- Native handling of all encodings (ASCII, US-ASCII, etc.)
- Error-tolerant parsing (always produces an AST)
- Future-proof: prism is Ruby's default parser since 3.3

Key changes:
- Cargo.toml: replace lib-ruby-parser with ruby-prism 1.9
- ast_helpers.rs: rewrite all helpers for prism node types
  (CallNode, DefNode, BlockNode, etc.)
- ast_visitor.rs: rewrite visitor for prism's Node enum
- analyzer.rs: adapt walk_node for Block/Call inversion
  (prism: CallNode owns BlockNode, not vice versa)
- fix.rs: simplify verify_syntax using prism
- comment_directives.rs: use prism's Comment iterator
- All 4 scanners rewritten for prism node types
- Remove custom ASCII encoding decoder (prism handles natively)

All 244 tests pass. Zero clippy warnings.
- Visit DefNode parameters (default values can contain scannable code)
- Remove unsafe ptr::read; replace body_expressions with safe
  body_expression_count/body_first_expression
- Remove duplicate visit_rescue_chain_children (identical to visit_rescue_children)
- Remove examples/prism_spike.rs (exploratory spike, not needed in release)
@7a6163 7a6163 merged commit 5016f64 into main Mar 16, 2026
8 checks passed
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