tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter
MIT License
182 stars 58 forks source link

Parser improvments: quoted heredocs and short-hand interpolations #225

Closed aibaars closed 2 years ago

aibaars commented 2 years ago

I auto-formatted src/scanner.cc in https://github.com/tree-sitter/tree-sitter-ruby/commit/293179e45b336af67122d724c634c3ebff49e999?w=1 . It's probably easiest to review on a commit-by-commit basis.

This pull request changes the scanner to no longer recognize interpolations and escape sequences in single quoted heredocs:

<<'EOF'
This is \not\ an interpolation: #{foo}
EOF

In addition it adds support for "short-hand" string interpolations of global, class, and instance variables, e.g:

"value: #@value"

Checklist: