Class: Code::Parser::UnaryMinus
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/unary_minus.rb', line 16
def minus
str("-")
end
|
20
21
22
|
# File 'lib/code/parser/unary_minus.rb', line 20
def operator
minus
end
|
24
25
26
27
28
|
# File 'lib/code/parser/unary_minus.rb', line 24
def root
(operator.aka(:operator) << whitespace? << unary_minus.aka(:right)).aka(
:unary_minus
) | ::Code::Parser::Power
end
|
#unary_minus ⇒ Object
4
5
6
|
# File 'lib/code/parser/unary_minus.rb', line 4
def unary_minus
::Code::Parser::UnaryMinus
end
|
#whitespace ⇒ Object
8
9
10
|
# File 'lib/code/parser/unary_minus.rb', line 8
def whitespace
::Code::Parser::Whitespace
end
|
#whitespace? ⇒ Boolean
12
13
14
|
# File 'lib/code/parser/unary_minus.rb', line 12
def whitespace?
whitespace.maybe
end
|