Module: EDNGRAMMAR::Streamstring2

Defined in:
lib/parser/edngrammar.rb

Instance Method Summary collapse

Instance Method Details

#astObject



4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
# File 'lib/parser/edngrammar.rb', line 4790

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