atom / language-ruby

Ruby package for Atom
Other
101 stars 144 forks source link

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

Closed willcosgrove closed 5 years ago

willcosgrove commented 5 years ago

Requirements

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

https://github.com/atom/language-ruby/blob/8cec2f9c34ec01f518306337cea1c167e150e3c4/grammars/ruby.cson#L154-L157

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 commented 5 years ago

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

jasonrudolph commented 5 years ago

Thanks for this, @willcosgrove! :cake: