Class: Treetop::Runtime::SyntaxNode

Inherits:
Object
  • Object
show all
Defined in:
lib/rulex/tex/node_extensions.rb

Direct Known Subclasses

Rulex::Tex::Grammar::CustomNode

Instance Method Summary collapse

Instance Method Details

#contentObject



12
13
14
# File 'lib/rulex/tex/node_extensions.rb', line 12

def content
  {}
end

#node_contentObject



6
7
8
9
10
11
# File 'lib/rulex/tex/node_extensions.rb', line 6

def node_content
  h = {type: :node} #, log: elements.to_s}
  h.merge!(:children => elements.map{|e| e.node_content}) if elements && !elements.empty?
  h.merge!(log: text_value)
  h.merge! content
end