Module: EDNGRAMMAR::Streamstring2

Defined in:
lib/parser/edngrammar.rb

Instance Method Summary collapse

Instance Method Details

#astObject



4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
# File 'lib/parser/edngrammar.rb', line 4001

def ast
  strings = [elements[2].ast] + elements[3].elements.map {|x| x.string.ast }
  unless Set[*strings.map(&:encoding)].size == 1
    warn "*** mixed streamstring #{strings.cbor_diagnostic}"
  end
  strings.each do |s|
    if CBOR::Xbox === s && (ei = s.options[:ei])
      warn "*** unimplemented encoding indicator #{ei.inspect} for #{s.inspect}"
    end
  end
  strings.join.cbor_stream!(strings.map(&:size)) # XXX loses EI
end