Class: Code::Parser::While
- Defined in:
- lib/code/parser/while.rb
Instance Method Summary collapse
- #code ⇒ Object
- #end_keyword ⇒ Object
- #loop_keyword ⇒ Object
- #root ⇒ Object
- #statement ⇒ Object
- #until_keyword ⇒ Object
- #while_keyword ⇒ Object
- #whitespace ⇒ Object
Instance Method Details
#end_keyword ⇒ Object
26 27 28 |
# File 'lib/code/parser/while.rb', line 26 def end_keyword str("end") end |
#loop_keyword ⇒ Object
30 31 32 |
# File 'lib/code/parser/while.rb', line 30 def loop_keyword str("loop") end |
#root ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/code/parser/while.rb', line 34 def root ( ( ( (while_keyword | until_keyword).aka(:operator) << whitespace << statement.aka(:statement) ) | (loop_keyword.aka(:operator) << whitespace) ) << code.aka(:body) << end_keyword.maybe ).aka(:while) | statement end |
#until_keyword ⇒ Object
22 23 24 |
# File 'lib/code/parser/while.rb', line 22 def until_keyword str("until") end |
#while_keyword ⇒ Object
18 19 20 |
# File 'lib/code/parser/while.rb', line 18 def while_keyword str("while") end |
#whitespace ⇒ Object
10 11 12 |
# File 'lib/code/parser/while.rb', line 10 def whitespace Whitespace end |