Skip to content

Commit

Permalink
Add missing node types to Meta::NODE_TYPES
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre authored and whitequark committed Apr 2, 2019
1 parent c6f45d0 commit 1f5084d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/parser/meta.rb
Expand Up @@ -23,6 +23,9 @@ module class sclass def defs undef alias args
until_post for break next redo return resbody
kwbegin begin retry preexe postexe iflipflop eflipflop
shadowarg complex rational __FILE__ __LINE__ __ENCODING__
ident root lambda indexasgn index procarg0
meth_ref restarg_expr blockarg_expr
objc_kwarg objc_restarg objc_varargs
).map(&:to_sym).to_set.freeze

end # Meta
Expand Down
7 changes: 7 additions & 0 deletions test/helper.rb
Expand Up @@ -50,3 +50,10 @@

$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'parser'

class Parser::AST::Node
def initialize(type, *)
raise "Type #{type} missing from Parser::Meta::NODE_TYPES" unless Parser::Meta::NODE_TYPES.include?(type)
super
end
end

0 comments on commit 1f5084d

Please sign in to comment.