Module: EDNGRAMMAR::Map3

Defined in:
lib/parser/edngrammar.rb

Instance Method Summary collapse

Instance Method Details

#astObject



1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
# File 'lib/parser/edngrammar.rb', line 1947

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