ruby / prism

Prism Ruby parser
https://ruby.github.io/prism/
MIT License
825 stars 139 forks source link

`Prism::Translation::RubyParser` - Module name with extend #2834

Closed presidentbeef closed 4 months ago

presidentbeef commented 4 months ago

Odd one. Nested module names are a call if there is an extend (should be a :colon2):

> RubyParser.new.parse("module A::B extend C; end")
 => s(:module, s(:colon2, s(:const, :A), :B), s(:call, nil, :extend, s(:const, :C))) 
> Prism::Translation::RubyParser.parse("module A::B extend C; end")
 => s(:module, s(:call, s(:const, :A), :B), s(:call, nil, :extend, s(:const, :C))) 
> Prism::Translation::RubyParser.parse("module A::B; end")
 => s(:module, s(:colon2, s(:const, :A), :B))

(Prism 0.29)

kddnewton commented 4 months ago

Thank you!

presidentbeef commented 4 months ago

Thanks @kddnewton, appreciate your quick fixes on these. I'm slowly going through issues I find as I try to get Brakeman moved over to using Prism.

kddnewton commented 4 months ago

Nice that's exciting!