pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/jruby/jruby/commit/7679764a7ac204b6dce25bcccea85ea3128e6084

/> Merge pull request #9355 from headius/if_modifier_line_fix · jruby/jruby@7679764 · GitHub
Skip to content

Commit 7679764

Browse files
authored
Merge pull request #9355 from headius/if_modifier_line_fix
Propagate newline from if to bodies
2 parents e433d66 + 31d1685 commit 7679764

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

core/src/main/java/org/jruby/parser/RubyParserBase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,14 @@ public void fixpos(Node node, Node orig) {
14011401
if (node == null || orig == null) return;
14021402

14031403
node.setLine(orig.getLine());
1404+
1405+
// Detect IfNode and propagate newline to the bodies.
1406+
// This is a bit of a form-fitted fix, but the full reduce_nodes logic from CRuby
1407+
// defied an initial porting attempt. See jruby/jruby#9293.
1408+
if (node.isNewline() && node instanceof IfNode ifNode) {
1409+
if (ifNode.getThenBody() instanceof Node thenNode) thenNode.setNewline();
1410+
if (ifNode.getElseBody() instanceof Node elseNode) elseNode.setNewline();
1411+
}
14041412
}
14051413

14061414
public Node new_fcall(ByteList operation) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy