Module: EDNGRAMMAR::RAppStringH6
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 |
# File 'lib/parser/edngrammar.rb', line 10765 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
10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 |
# File 'lib/parser/edngrammar.rb', line 10755 def unpack_thread(s) case s[0] when CBOR::Tagged s[0] when String s.join else raise "@@@ unpack_thread #{s.inspect}" end end |