Module: EDNGRAMMAR::Map3

Defined in:
lib/parser/edngrammar.rb

Instance Method Summary collapse

Instance Method Details

#astObject



2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
# File 'lib/parser/edngrammar.rb', line 2129

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