Class: Language::Atom::Then
Instance Method Summary
collapse
#<<, #>>, #absent, #aka, #any, #ignore, #inspect, #maybe, #repeat, #rule, #str, #then, #|
Constructor Details
#initialize(parent:, block:) ⇒ Then
28
29
30
31
|
# File 'lib/language/atom.rb', line 28
def initialize(parent:, block:)
@parent = parent
@block = block
end
|
Instance Method Details
#parse(parser) ⇒ Object
33
34
35
36
|
# File 'lib/language/atom.rb', line 33
def parse(parser)
@parent.parse(parser)
parser.output = Output.from_raw(@block.call(parser.output.to_raw))
end
|
#to_s ⇒ Object
38
39
40
|
# File 'lib/language/atom.rb', line 38
def to_s
"(#{@parent}).then {}"
end
|