Module: EDNGRAMMAR::AppStringH6
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 |
# File 'lib/parser/edngrammar.rb', line 7574 def ast e1 = elements[1].elements.map {|e| e.ast} out = [] curr = [] e1.each { |el| if curr.size == 0 || curr[0].class == el.class curr << el else out << curr curr = [el] end } if out.size == 0 && (curr.size == 0 || String === curr[0]) curr.join.b # unpack_thread(curr) else CBOR::Tagged.new(888, (out << curr).map {|x| unpack_thread(x)}) end end |
#unpack_thread(s) ⇒ Object
7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 |
# File 'lib/parser/edngrammar.rb', line 7564 def unpack_thread(s) case s[0] when CBOR::Tagged s[0] when String s.join else raise "@@@ unpack_thread #{s.inspect}" end end |