Class: Code::Parser::Code
Instance Method Summary
collapse
Methods inherited from Language
<<, >>, absent, aka, #any, ignore, #inspect, maybe, parse, #parse, repeat, #str, then, #to_s, |
Instance Method Details
16
17
18
|
# File 'lib/code/parser/code.rb', line 16
def present
(whitespace? << statement << whitespace?).repeat(1)
end
|
20
21
22
|
# File 'lib/code/parser/code.rb', line 20
def root
present | whitespace?.then { [] }
end
|
#statement ⇒ Object
12
13
14
|
# File 'lib/code/parser/code.rb', line 12
def statement
::Code::Parser::Statement
end
|
#whitespace ⇒ Object
4
5
6
|
# File 'lib/code/parser/code.rb', line 4
def whitespace
::Code::Parser::Whitespace
end
|
#whitespace?(&block) ⇒ Boolean
8
9
10
|
# File 'lib/code/parser/code.rb', line 8
def whitespace?(&block)
whitespace.maybe(&block)
end
|