Skip to content

Commit

Permalink
begin node line should not get added if it has been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Apr 22, 2024
1 parent 99f6b2c commit 0b09b2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/jruby/parser/RubyParserBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ protected void getterIdentifierError(RubySymbol identifier) {
public Node newline_node(Node node, int line) {
if (node == null) return null;

node = remove_begin(node);
Node newNode = remove_begin(node);
// Conservative fix...try and use line unless we see remove has been removed then use the newNode.
if (newNode != node) line = newNode.getLine();
coverLine(line);
node.setNewline();

Expand Down

0 comments on commit 0b09b2b

Please sign in to comment.