Module: EDNGRAMMAR::Array3

Defined in:
lib/parser/edngrammar.rb

Instance Method Summary collapse

Instance Method Details

#astObject



1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
# File 'lib/parser/edngrammar.rb', line 1955

def ast
  r = if e = elements[3].elements
        [e[0].ast] + e[2].elements.map {|x| x.item.ast }
      else
        []
      end
  if ei = spec.text_value[1..-1]
     #       warn "** ei #{ei.inspect}"
     if ei == ""
       r.cbor_stream!
     else
       warn "*** ignoring unimplemented encoding indicator #{ei.inspect} after ["
     end
  end
  r
end