Skip to content

Commit 4afc0be

Browse files
committed
Fix doc comments about Super nodes
1 parent 70d3a29 commit 4afc0be

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
@@ -2215,7 +2215,9 @@ unique_ptr<parser::Node> Translator::translate(pm_node_t *node, bool preserveCon
22152215
// Desugared in desugarParametersNode().
22162216
return make_unique<parser::ForwardArg>(location);
22172217
}
2218-
case PM_FORWARDING_SUPER_NODE: { // `super` with no `(...)`
2218+
case PM_FORWARDING_SUPER_NODE: { // A `super` with no explicit arguments
2219+
// It might have a literal block argument, though.
2220+
22192221
auto forwardingSuperNode = down_cast<pm_forwarding_super_node>(node);
22202222

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

30973099
return make_node_with_expr<parser::String>(MK::String(location, content), location, content);
30983100
}
3099-
case PM_SUPER_NODE: { // The `super` keyword, like `super`, `super(a, b)`
3101+
case PM_SUPER_NODE: { // A `super` call with explicit args, like `super()`, `super(a, b)`
3102+
// If there's no arguments (except a literal block argument), then it's a `PM_FORWARDING_SUPER_NODE`.
3103+
31003104
auto superNode = down_cast<pm_super_node>(node);
31013105

31023106
auto blockArgumentNode = superNode->block;

0 commit comments

Comments
 (0)