Class: Code::Parser::Group
- Defined in:
- lib/code/parser/group.rb
Instance Method Summary collapse
- #begin_keyword ⇒ Object
- #closing_parenthesis ⇒ Object
- #code ⇒ Object
- #do_keyword ⇒ Object
- #end_keyword ⇒ Object
- #opening_parenthesis ⇒ Object
- #root ⇒ Object
- #whitespace ⇒ Object
- #whitespace? ⇒ Boolean
Instance Method Details
#begin_keyword ⇒ Object
34 35 36 |
# File 'lib/code/parser/group.rb', line 34 def begin_keyword str("begin") end |
#closing_parenthesis ⇒ Object
22 23 24 |
# File 'lib/code/parser/group.rb', line 22 def closing_parenthesis str(")") end |
#code ⇒ Object
6 7 8 |
# File 'lib/code/parser/group.rb', line 6 def code Code end |
#do_keyword ⇒ Object
30 31 32 |
# File 'lib/code/parser/group.rb', line 30 def do_keyword str("do") end |
#end_keyword ⇒ Object
26 27 28 |
# File 'lib/code/parser/group.rb', line 26 def end_keyword str("end") end |
#opening_parenthesis ⇒ Object
18 19 20 |
# File 'lib/code/parser/group.rb', line 18 def opening_parenthesis str("(") end |
#root ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/code/parser/group.rb', line 38 def root ( opening_parenthesis.ignore << whitespace? << code << (whitespace? << closing_parenthesis).maybe.ignore ).aka(:group) | ( begin_keyword.ignore << whitespace << code << (whitespace? << end_keyword).maybe.ignore ).aka(:group) | ( do_keyword.ignore << whitespace << code << (whitespace? << end_keyword).maybe.ignore ).aka(:group) | Call end |
#whitespace ⇒ Object
10 11 12 |
# File 'lib/code/parser/group.rb', line 10 def whitespace Whitespace end |
#whitespace? ⇒ Boolean
14 15 16 |
# File 'lib/code/parser/group.rb', line 14 def whitespace? whitespace.maybe end |