Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -29,10 +29,11 @@
public class OpenModuleNode extends RubyNode {

@Child private RubyNode definingModule;
@Child private MethodDefinitionNode definitionMethod;
final protected LexicalScope lexicalScope;
@Child private IndirectCallNode callModuleDefinitionNode;

final private MethodDefinitionNode definitionMethod;

public OpenModuleNode(RubyContext context, SourceSection sourceSection, RubyNode definingModule, MethodDefinitionNode definitionMethod, LexicalScope lexicalScope) {
super(context, sourceSection);
this.definingModule = definingModule;

3 comments on commit 574f975

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we lost the @Child here?

@eregon
Copy link
Member Author

@eregon eregon commented on 574f975 Feb 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's on purpose so the AST of a module body is not included in the surrounding scope (module or top-level). One way to make this clearer would be to pass the definitionMethod as a Calltarget as we do for normal methods.

Sorry, something went wrong.

@eregon
Copy link
Member Author

@eregon eregon commented on 574f975 Feb 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code seems fine, since the definition node does not include the body in its @Child but as a CallTarget.

Sorry, something went wrong.

Please sign in to comment.