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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add `next` keyword to Tree Sitter's keyword.control scope #262

Merged
merged 1 commit into from Apr 2, 2019

Conversation

Projects
None yet
3 participants
@willcosgrove
Copy link
Contributor

commented Feb 12, 2019

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

This adds the ruby next keyword to the list of keywords in the keyword.control scope. I actually noticed several missing keywords compared to the old grammar

{
'match': '(?<!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\\b(?![?!])|\\bdefined\\?|\\b(block_given|iterator)\\?'
'name': 'keyword.control.pseudo-method.ruby'
}

But I only really wanted the next keyword at the moment, and didn't want to hurt this PR's chances of getting merged by including other keywords. You can see that the new grammar is missing redo, super, undef, block_given?, defined?, among others. I did just notice that this excerpt is from a different scope, but I would still consider some of these to be control keywords.

Edit by @rsese to add a screenshot and copy/paste code

(1..10).each do |i|
  if i % 2 == 0
   puts "even"
   next
  end
  puts i
end

Missing scope:

tree-sitter

Alternate Designs

I did not consider any alternate designs.

Benefits

馃寛

Possible Drawbacks

None?

Applicable Issues

None.

@rsese

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

Thanks! Someone from the team will take a look as soon as they can.

@rsese rsese assigned rsese and unassigned rsese Feb 13, 2019

@jasonrudolph jasonrudolph merged commit 2d1e477 into atom:master Apr 2, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jasonrudolph

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

Thanks for this, @willcosgrove! 馃嵃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.