Skip to content

Commit 68ac62c

Browse files
committed
Fix doc comments about Super nodes
1 parent 690717f commit 68ac62c

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
@@ -2262,7 +2262,9 @@ unique_ptr<parser::Node> Translator::translate(pm_node_t *node, bool preserveCon
22622262
// Desugared in desugarParametersNode().
22632263
return make_unique<parser::ForwardArg>(location);
22642264
}
2265-
case PM_FORWARDING_SUPER_NODE: { // `super` with no `(...)`
2265+
case PM_FORWARDING_SUPER_NODE: { // A `super` with no explicit arguments
2266+
// It might have a literal block argument, though.
2267+
22662268
auto forwardingSuperNode = down_cast<pm_forwarding_super_node>(node);
22672269

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

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

31763180
auto blockArgumentNode = superNode->block;

0 commit comments

Comments
 (0)