Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby: update tree-sitter-ruby #9868

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Conversation

aibaars
Copy link
Contributor

@aibaars aibaars commented Jul 20, 2022

@github-actions github-actions bot added the Ruby label Jul 20, 2022
@aibaars aibaars force-pushed the update-tree-sitter-ruby-3 branch from 9935b30 to 8d80e03 Compare July 20, 2022 16:17
@aibaars aibaars marked this pull request as ready for review July 20, 2022 16:17
@aibaars aibaars requested a review from a team as a code owner July 20, 2022 16:17
@nickrolfe
Copy link
Contributor

Looking at DCA, do you know why the "Lines of code in the database" metric changed?

@aibaars
Copy link
Contributor Author

aibaars commented Jul 21, 2022

Looking at DCA, do you know why the "Lines of code in the database" metric changed?

Good question. It turns out that all differences are in files with __END__ blocks. Before this PR the uninterpreted block would start right after the __END__ marker and as a result include the newline after the __END__. In the updated grammar the newline is consumed as part of the __END__[\r\n] token. As a result the uninterpreted block starts on the line after the __END__. I think that is actually better.

For reference these are the files on the opal/opal project that are affected by this:

707,709c707,709
< | opal/spec/opal/core/language/DATA/characters_support_spec.rb           |     8 |
< | opal/spec/opal/core/language/DATA/empty___END___spec.rb                |     5 |
< | opal/spec/opal/core/language/DATA/multiple___END___spec.rb             |     9 |
---
> | opal/spec/opal/core/language/DATA/characters_support_spec.rb           |     7 |
> | opal/spec/opal/core/language/DATA/empty___END___spec.rb                |     6 |
> | opal/spec/opal/core/language/DATA/multiple___END___spec.rb             |     8 |
3246c3246
< | opal/spec/ruby/language/predefined/fixtures/data1.rb                   |     3 |
---
> | opal/spec/ruby/language/predefined/fixtures/data1.rb                   |     2 |
3248,3252c3248,3252
< | opal/spec/ruby/language/predefined/fixtures/data3.rb                   |     4 |
< | opal/spec/ruby/language/predefined/fixtures/data4.rb                   |     2 |
< | opal/spec/ruby/language/predefined/fixtures/data5.rb                   |     4 |
< | opal/spec/ruby/language/predefined/fixtures/data_offset.rb             |     8 |
< | opal/spec/ruby/language/predefined/fixtures/data_only.rb               |     2 |
---
> | opal/spec/ruby/language/predefined/fixtures/data3.rb                   |     3 |
> | opal/spec/ruby/language/predefined/fixtures/data4.rb                   |     1 |
> | opal/spec/ruby/language/predefined/fixtures/data5.rb                   |     3 |
> | opal/spec/ruby/language/predefined/fixtures/data_offset.rb             |     7 |
> | opal/spec/ruby/language/predefined/fixtures/data_only.rb               |     1 |
5734c5734
< | opal/test/cruby/ext/etc/mkconstants.rb                                 |   317 |
---
> | opal/test/cruby/ext/etc/mkconstants.rb                                 |   316 |
5859c5859
< | opal/test/cruby/ext/socket/mkconstants.rb                              |   773 |
---
> | opal/test/cruby/ext/socket/mkconstants.rb                              |   772 |
6818c6818
< | opal/test/cruby/sample/from.rb                                         |   100 |
---
> | opal/test/cruby/sample/from.rb                                         |    99 |
9715c9715
< | opal/test/cruby/spec/ruby/language/predefined/fixtures/data1.rb        |     3 |
---
> | opal/test/cruby/spec/ruby/language/predefined/fixtures/data1.rb        |     2 |
9717,9721c9717,9721
< | opal/test/cruby/spec/ruby/language/predefined/fixtures/data3.rb        |     4 |
< | opal/test/cruby/spec/ruby/language/predefined/fixtures/data4.rb        |     2 |
< | opal/test/cruby/spec/ruby/language/predefined/fixtures/data5.rb        |     4 |
< | opal/test/cruby/spec/ruby/language/predefined/fixtures/data_offset.rb  |     8 |
< | opal/test/cruby/spec/ruby/language/predefined/fixtures/data_only.rb    |     2 |
---
> | opal/test/cruby/spec/ruby/language/predefined/fixtures/data3.rb        |     3 |
> | opal/test/cruby/spec/ruby/language/predefined/fixtures/data4.rb        |     1 |
> | opal/test/cruby/spec/ruby/language/predefined/fixtures/data5.rb        |     3 |
> | opal/test/cruby/spec/ruby/language/predefined/fixtures/data_offset.rb  |     7 |
> | opal/test/cruby/spec/ruby/language/predefined/fixtures/data_only.rb    |     1 |

Copy link
Contributor

@nickrolfe nickrolfe left a comment

Choose a reason for hiding this comment

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

Excellent, that makes sense.

@aibaars aibaars merged commit 27be3df into github:main Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants