Skip to content

Commit 7af0a9a

Browse files
committed
Fix doc comments about Super nodes
1 parent 1f92b25 commit 7af0a9a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

parser/prism/Translator.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,7 +2263,9 @@ unique_ptr<parser::Node> Translator::translate(pm_node_t *node, bool preserveCon
22632263
// Desugared in desugarParametersNode().
22642264
return make_unique<parser::ForwardArg>(location);
22652265
}
2266-
case PM_FORWARDING_SUPER_NODE: { // `super` with no `(...)`
2266+
case PM_FORWARDING_SUPER_NODE: { // A `super` with no explicit arguments
2267+
// It might have a literal block argument, though.
2268+
22672269
auto forwardingSuperNode = down_cast<pm_forwarding_super_node>(node);
22682270

22692271
// There's no `keyword_loc` field, so we make it ourselves from the start location.
@@ -3171,7 +3173,9 @@ unique_ptr<parser::Node> Translator::translate(pm_node_t *node, bool preserveCon
31713173

31723174
return make_node_with_expr<parser::String>(MK::String(location, content), location, content);
31733175
}
3174-
case PM_SUPER_NODE: { // The `super` keyword, like `super`, `super(a, b)`
3176+
case PM_SUPER_NODE: { // A `super` call with explicit args, like `super()`, `super(a, b)`
3177+
// If there's no arguments (except a literal block argument), then it's a `PM_FORWARDING_SUPER_NODE`.
3178+
31753179
auto superNode = down_cast<pm_super_node>(node);
31763180

31773181
auto blockArgumentNode = superNode->block;

0 commit comments

Comments
 (0)