Class: ExpressionNode

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/texticle/nodes/expression_node.rb

Instance Method Summary collapse

Instance Method Details

#to_tqueryObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/texticle/nodes/expression_node.rb', line 2

def to_tquery
  buffer = []
  elements[0].elements.each do |elem|
    if elem.respond_to?(:to_tquery)
      t = elem.to_tquery
      if t =~ /^\s+(\||&).*$/ || buffer.empty?
        buffer << t
      else
        buffer << " | " + t
      end
    end
  end
  
  buffer.join(' ')
end