Module: EDNGRAMMAR::SAppStringH6
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 |
# File 'lib/parser/edngrammar.rb', line 9228 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
9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 |
# File 'lib/parser/edngrammar.rb', line 9218 def unpack_thread(s) case s[0] when CBOR::Tagged s[0] when String s.join else raise "@@@ unpack_thread #{s.inspect}" end end |