Class: Marker::RecursiveList
- Inherits:
-
ParseNode
- Object
- Treetop::Runtime::SyntaxNode
- ParseNode
- Marker::RecursiveList
- Defined in:
- lib/marker/common.rb
Overview
implements collection methods on a list using a recursive grammar definition requires defining h
and r
Instance Method Summary collapse
Methods inherited from Treetop::Runtime::SyntaxNode
Instance Method Details
#r ⇒ Object
36 37 38 |
# File 'lib/marker/common.rb', line 36 def r nil end |
#single? ⇒ Boolean
40 41 42 |
# File 'lib/marker/common.rb', line 40 def single? r.nil? end |
#to_a ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/marker/common.rb', line 28 def to_a if r [h] + r.to_a else [h] end end |