Module: EDNGRAMMAR::AppStringH6
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 |
# File 'lib/parser/edngrammar.rb', line 8034 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
8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 |
# File 'lib/parser/edngrammar.rb', line 8024 def unpack_thread(s) case s[0] when CBOR::Tagged s[0] when String s.join else raise "@@@ unpack_thread #{s.inspect}" end end |