Class: Code::Parser::RightOperation
- Inherits:
-
Language
- Object
- Language
- Code::Parser::RightOperation
show all
- Defined in:
- lib/code/parser/right_operation.rb
Instance Method Summary
collapse
Instance Method Details
18
19
20
|
# File 'lib/code/parser/right_operation.rb', line 18
def operator
raise NotImplementedError
end
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/code/parser/right_operation.rb', line 22
def root
(
statement.aka(:left) << (
whitespace? << operator.aka(:operator) << whitespace? <<
self.class.aka(:right)
).maybe
)
.aka(:right_operation)
.then do |output|
if output[:right_operation][:right]
output
else
output[:right_operation][:left]
end
end
end
|
#statement ⇒ Object
6
7
8
|
# File 'lib/code/parser/right_operation.rb', line 6
def statement
raise NotImplementedError
end
|
#whitespace ⇒ Object
10
11
12
|
# File 'lib/code/parser/right_operation.rb', line 10
def whitespace
Whitespace
end
|
#whitespace? ⇒ Boolean
14
15
16
|
# File 'lib/code/parser/right_operation.rb', line 14
def whitespace?
whitespace.maybe
end
|