Skip to content

Ruby 3.1 features#201

Merged
aibaars merged 6 commits intotree-sitter:masterfrom
aibaars:ruby-3.1
Jan 28, 2022
Merged

Ruby 3.1 features#201
aibaars merged 6 commits intotree-sitter:masterfrom
aibaars:ruby-3.1

Conversation

@aibaars
Copy link
Copy Markdown
Contributor

@aibaars aibaars commented Jan 18, 2022

This pull-request Implements the following items taken from https://rubyreferences.github.io/rubychanges/3.1.html

  • Values in Hash literals and keyword arguments can be omitted
  • Anonymous block argument
  • Expressions and non-local variables allowed in pin operator ^

The following items are not addressed by this pull request as did not yet find a good way to implement them without causing all sorts of grammar conflicts.

  • One-line pattern matching (both versions) is no longer experimental
  • Inside “endless” method definitions, method calls without parenthesis are allowed

Checklist:

  • All tests pass in CI.
  • There are sufficient tests for the new fix/feature.
  • Grammar rules have not been renamed unless absolutely necessary.
  • The conflicts section hasn't grown too much.
  • The parser size hasn't grown too much (check the value of STATE_COUNT in src/parser.c).

@aibaars aibaars marked this pull request as ready for review January 18, 2022 15:03
@aibaars aibaars requested a review from maxbrunsfeld January 18, 2022 15:03
@aibaars
Copy link
Copy Markdown
Contributor Author

aibaars commented Jan 18, 2022

@nickrolfe

Copy link
Copy Markdown
Contributor

@tclem tclem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar changes look reasonable, corpus tests make sense. I spot checked the example tests (ruby_spec) and the results are identical to the last run on main:

Successfully parsed 4259 of 4264 example files (99.9%)

👍

@aibaars aibaars merged commit 1ebfdb2 into tree-sitter:master Jan 28, 2022
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.

2 participants