Module: EDNGRAMMAR::Streamstring2

Defined in:
lib/parser/edngrammar.rb

Instance Method Summary collapse

Instance Method Details

#astObject



2815
2816
2817
2818
2819
2820
2821
# File 'lib/parser/edngrammar.rb', line 2815

def ast
  strings = [elements[2].ast] + elements[4].elements.map {|x| x.string.ast }
  unless Set[*strings.map(&:encoding)].size == 1
    warn "*** mixed streamstring #{strings.cbor_diagnostic}"
  end
  strings.join.cbor_stream!(strings.map(&:size))
end