class Crystal::Normalizer
inherits Crystal::Transformer
¶
Class methods¶
Methods¶
#current_def : Def?
¶
: Def?
The current method where we are normalizing.
This is used to expand argless super
and previous_def
to their version with arguments copied from the current method.
#current_def=(current_def : Def?)
¶
(current_def : Def?)
The current method where we are normalizing.
This is used to expand argless super
and previous_def
to their version with arguments copied from the current method.
#transform(node : Until)
¶
(node : Until)
Convert until to while:
From:
until foo bar end
To:
while !foo bar end
#transform(node : Unless)
¶
(node : Unless)
Convert unless to if:
From:
unless foo
bar
else
baz
end
To:
if foo
baz
else
bar
end