thought to be useful sat addition
This commit is contained in:
parent
e952495eb1
commit
e2054660ce
@ -1,3 +1,22 @@
|
|||||||
require 'parslet'
|
require 'parslet'
|
||||||
require 'parser/salama'
|
require 'parser/salama'
|
||||||
|
require "ast"
|
||||||
require 'parser/transform'
|
require 'parser/transform'
|
||||||
|
|
||||||
|
AST::Node.class_eval do
|
||||||
|
|
||||||
|
def [](name)
|
||||||
|
puts self.inspect
|
||||||
|
children.each do |child|
|
||||||
|
if child.is_a?(AST::Node)
|
||||||
|
puts child.type
|
||||||
|
if (child.type == name)
|
||||||
|
return child.children
|
||||||
|
end
|
||||||
|
else
|
||||||
|
puts child.class
|
||||||
|
end
|
||||||
|
end
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user