Repository: ruby/prism
Pull request #2954 (2024-07-23 18:33:17)

Single line method bodies should not be marked as newline


Patch:
diff --git a/src/prism.c b/src/prism.c
index 1e2f71cf..9168c520 100644
--- a/src/prism.c
+++ b/src/prism.c
@@ -1886,7 +1886,7 @@ static pm_statements_node_t *
 pm_statements_node_create(pm_parser_t *parser);
 
 static void
-pm_statements_node_body_append(pm_parser_t *parser, pm_statements_node_t *node, pm_node_t *statement);
+pm_statements_node_body_append(pm_parser_t *parser, pm_statements_node_t *node, pm_node_t *statement, bool newline);
 
 static size_t
 pm_statements_node_body_length(pm_statements_node_t *node);
@@ -4721,7 +4721,7 @@ pm_if_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const pm_t
     pm_if_node_t *node = PM_NODE_ALLOC(parser, pm_if_node_t);
 
     pm_statements_node_t *statements = pm_statements_node_create(parser);
-    pm_statements_node_body_append(parser, statements, statement);
+    pm_statements_node_body_append(parser, statements, statement, true);
 
     *node = (pm_if_node_t) {
         {
@@ -4753,10 +4753,10 @@ pm_if_node_ternary_create(pm_parser_t *parser, pm_node_t *predicate, const pm_to
     pm_conditional_predicate(parser, predicate, PM_CONDITIONAL_PREDICATE_TYPE_CONDITIONAL);
 
     pm_statements_node_t *if_statements = pm_statements_node_create(parser);
-    pm_statements_node_body_append(parser, if_statements, true_expression);
+    pm_statements_node_body_append(parser, if_statements, true_expression, true);
 
     pm_statements_node_t *else_statements = pm_statements_node_create(parser);
-    pm_statements_node_body_append(parser, else_statements, false_expression);
+    pm_statements_node_body_append(parser, else_statements, false_expression, true);
 
     pm_token_t end_keyword = not_provided(parser);
     pm_else_node_t *else_node = pm_else_node_create(parser, colon, else_statements, &end_keyword);
@@ -6959,7 +6959,7 @@ pm_statements_node_body_update(pm_statements_node_t *node, pm_node_t *statement)
  * Append a new node to the given StatementsNode node's body.
  */
 static void
-pm_statements_node_body_append(pm_parser_t *parser, pm_statements_node_t *node, pm_node_t *statement) {
+pm_statements_node_body_append(pm_parser_t *parser, pm_statements_node_t *node, pm_node_t *statement, bool newline) {
     pm_statements_node_body_update(node, statement);
 
     if (node->body.size > 0) {
@@ -6979,7 +6979,7 @@ pm_statements_node_body_append(pm_parser_t *parser, pm_statements_node_t *node,
     }
 
     pm_node_list_append(&node->body, statement);
-    pm_node_flag_set(statement, PM_NODE_FLAG_NEWLINE);
+    if (newline) pm_node_flag_set(statement, PM_NODE_FLAG_NEWLINE);
 }
 
 /**
@@ -7597,7 +7597,7 @@ pm_unless_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const
     pm_unless_node_t *node = PM_NODE_ALLOC(parser, pm_unless_node_t);
 
     pm_statements_node_t *statements = pm_statements_node_create(parser);
-    pm_statements_node_body_append(parser, statements, statement);
+    pm_statements_node_body_append(parser, statements, statement, true);
 
     *node = (pm_unless_node_t) {
         {
@@ -13754,7 +13754,7 @@ parse_statements(pm_parser_t *parser, pm_context_t context) {
 
     while (true) {
         pm_node_t *node = parse_expression(parser, PM_BINDING_POWER_STATEMENT, true, PM_ERR_CANNOT_PARSE_EXPRESSION);
-        pm_statements_node_body_append(parser, statements, node);
+        pm_statements_node_body_append(parser, statements, node, true);
 
         // If we're recovering from a syntax error, then we need to stop parsing
         // the statements now.
@@ -17940,7 +17940,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
                 // and we didn't return a multiple assignment node, then we can return a
                 // regular parentheses node now.
                 pm_statements_node_t *statements = pm_statements_node_create(parser);
-                pm_statements_node_body_append(parser, statements, statement);
+                pm_statements_node_body_append(parser, statements, statement, true);
 
                 return (pm_node_t *) pm_parentheses_node_create(parser, &opening, (pm_node_t *) statements, &parser->previous);
             }
@@ -17950,7 +17950,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
             // We'll do that here.
             context_push(parser, PM_CONTEXT_PARENS);
             pm_statements_node_t *statements = pm_statements_node_create(parser);
-            pm_statements_node_body_append(parser, statements, statement);
+            pm_statements_node_body_append(parser, statements, statement, true);
 
             // If we didn't find a terminator and we didn't find a right
             // parenthesis, then this is a syntax error.
@@ -17961,7 +17961,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
             // Parse each statement within the parentheses.
             while (true) {
                 pm_node_t *node = parse_expression(parser, PM_BINDING_POWER_STATEMENT, true, PM_ERR_CANNOT_PARSE_EXPRESSION);
-                pm_statements_node_body_append(parser, statements, node);
+                pm_statements_node_body_append(parser, statements, node, true);
 
                 // If we're recovering from a syntax error, then we need to stop
                 // parsing the statements now.
@@ -19123,7 +19123,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
                     statement = (pm_node_t *) pm_rescue_modifier_node_create(parser, statement, &rescue_keyword, value);
                 }
 
-                pm_statements_node_body_append(parser, (pm_statements_node_t *) statements, statement);
+                pm_statements_node_body_append(parser, (pm_statements_node_t *) statements, statement, false);
                 pm_do_loop_stack_pop(parser);
                 context_pop(parser);
                 end_keyword = not_provided(parser);
@@ -21190,7 +21190,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t
         case PM_TOKEN_KEYWORD_UNTIL_MODIFIER: {
             parser_lex(parser);
             pm_statements_node_t *statements = pm_statements_node_create(parser);
-            pm_statements_node_body_append(parser, statements, node);
+            pm_statements_node_body_append(parser, statements, node, true);
 
             pm_node_t *predicate = parse_value_expression(parser, binding_power, true, PM_ERR_CONDITIONAL_UNTIL_PREDICATE);
             return (pm_node_t *) pm_until_node_modifier_create(parser, &token, predicate, statements, PM_NODE_TYPE_P(node, PM_BEGIN_NODE) ? PM_LOOP_FLAGS_BEGIN_MODIFIER : 0);
@@ -21198,7 +21198,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t
         case PM_TOKEN_KEYWORD_WHILE_MODIFIER: {
             parser_lex(parser);
             pm_statements_node_t *statements = pm_statements_node_create(parser);
-            pm_statements_node_body_append(parser, statements, node);
+            pm_statements_node_body_append(parser, statements, node, true);
 
             pm_node_t *predicate = parse_value_expression(parser, binding_power, true, PM_ERR_CONDITIONAL_WHILE_PREDICATE);
             return (pm_node_t *) pm_while_node_modifier_create(parser, &token, predicate, statements, PM_NODE_TYPE_P(node, PM_BEGIN_NODE) ? PM_LOOP_FLAGS_BEGIN_MODIFIER : 0);
@@ -21566,7 +21566,7 @@ wrap_statements(pm_parser_t *parser, pm_statements_node_t *statements) {
             parser,
             arguments,
             pm_parser_constant_id_constant(parser, "print", 5)
-        ));
+        ), true);
     }
 
     if (PM_PARSER_COMMAND_LINE_OPTION_N(parser)) {
@@ -21612,7 +21612,7 @@ wrap_statements(pm_parser_t *parser, pm_statements_node_t *statements) {
             parser,
             (pm_node_t *) pm_call_node_fcall_synthesized_create(parser, arguments, pm_parser_constant_id_constant(parser, "gets", 4)),
             statements
-        ));
+        ), true);
 
         statements = wrapped_statements;
     }


Test patch:
diff --git a/test/prism/snapshots/command_method_call.txt b/test/prism/snapshots/command_method_call.txt
index 2c0f44e5..f0d9c6ce 100644
--- a/test/prism/snapshots/command_method_call.txt
+++ b/test/prism/snapshots/command_method_call.txt
@@ -435,7 +435,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (25,10)-(25,15))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :bar
diff --git a/test/prism/snapshots/endless_methods.txt b/test/prism/snapshots/endless_methods.txt
index 50a0f41a..29f701ed 100644
--- a/test/prism/snapshots/endless_methods.txt
+++ b/test/prism/snapshots/endless_methods.txt
@@ -16,7 +16,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (1,10)-(1,11))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 1
         │   ├── locals: []
         │   ├── def_keyword_loc: (1,0)-(1,3) = "def"
@@ -36,7 +36,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (3,10)-(3,14))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :A
@@ -72,7 +72,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (5,13)-(5,22))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── receiver:
             │           │   @ CallNode (location: (5,13)-(5,18))
             │           │   ├── flags: ∅
diff --git a/test/prism/snapshots/methods.txt b/test/prism/snapshots/methods.txt
index 0fd1a7f4..42f87b75 100644
--- a/test/prism/snapshots/methods.txt
+++ b/test/prism/snapshots/methods.txt
@@ -927,7 +927,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (103,10)-(103,11))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 1
         │   ├── locals: []
         │   ├── def_keyword_loc: (103,0)-(103,3) = "def"
@@ -947,7 +947,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (104,10)-(104,11))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 2
         │   ├── locals: []
         │   ├── def_keyword_loc: (104,0)-(104,3) = "def"
@@ -979,7 +979,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (106,15)-(106,18))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 123
         │   ├── locals: [:bar]
         │   ├── def_keyword_loc: (106,0)-(106,3) = "def"
@@ -999,7 +999,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (108,10)-(108,13))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 123
         │   ├── locals: []
         │   ├── def_keyword_loc: (108,0)-(108,3) = "def"
@@ -2153,7 +2153,7 @@
         │   │   │           │       │   │   ├── flags: ∅
         │   │   │           │       │   │   └── body: (length: 1)
         │   │   │           │       │   │       └── @ LocalVariableReadNode (location: (181,30)-(181,33))
-        │   │   │           │       │   │           ├── flags: newline
+        │   │   │           │       │   │           ├── flags: ∅
         │   │   │           │       │   │           ├── name: :bar
         │   │   │           │       │   │           └── depth: 0
         │   │   │           │       │   ├── locals: [:bar]
@@ -2178,7 +2178,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (181,41)-(181,42))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 2
         │   ├── locals: [:bar]
         │   ├── def_keyword_loc: (181,0)-(181,3) = "def"
@@ -2234,7 +2234,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ IntegerNode (location: (183,36)-(183,37))
-            │           ├── flags: newline, static_literal, decimal
+            │           ├── flags: static_literal, decimal
             │           └── value: 2
             ├── locals: [:bar]
             ├── def_keyword_loc: (183,0)-(183,3) = "def"
diff --git a/test/prism/snapshots/regex.txt b/test/prism/snapshots/regex.txt
index 2f4b986d..17f12e18 100644
--- a/test/prism/snapshots/regex.txt
+++ b/test/prism/snapshots/regex.txt
@@ -498,7 +498,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ MatchWriteNode (location: (46,16)-(46,32))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── call:
             │           │   @ CallNode (location: (46,16)-(46,32))
             │           │   ├── flags: ∅
diff --git a/test/prism/snapshots/rescue.txt b/test/prism/snapshots/rescue.txt
index 53a49fbb..705758c5 100644
--- a/test/prism/snapshots/rescue.txt
+++ b/test/prism/snapshots/rescue.txt
@@ -376,7 +376,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ RescueModifierNode (location: (26,18)-(26,44))
-        │   │           ├── flags: newline
+        │   │           ├── flags: ∅
         │   │           ├── expression:
         │   │           │   @ CallNode (location: (26,18)-(26,33))
         │   │           │   ├── flags: ignore_visibility
diff --git a/test/prism/snapshots/seattlerb/defn_endless_command.txt b/test/prism/snapshots/seattlerb/defn_endless_command.txt
index e951ee2e..12149a82 100644
--- a/test/prism/snapshots/seattlerb/defn_endless_command.txt
+++ b/test/prism/snapshots/seattlerb/defn_endless_command.txt
@@ -16,7 +16,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (1,18)-(1,33))
-            │           ├── flags: newline, ignore_visibility
+            │           ├── flags: ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :other_method
diff --git a/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt b/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt
index 7efd02cd..99194a5c 100644
--- a/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt
+++ b/test/prism/snapshots/seattlerb/defn_endless_command_rescue.txt
@@ -16,7 +16,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ RescueModifierNode (location: (1,18)-(1,43))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── expression:
             │           │   @ CallNode (location: (1,18)-(1,33))
             │           │   ├── flags: ignore_visibility
diff --git a/test/prism/snapshots/seattlerb/defn_oneliner.txt b/test/prism/snapshots/seattlerb/defn_oneliner.txt
index efa53f09..81ca22f0 100644
--- a/test/prism/snapshots/seattlerb/defn_oneliner.txt
+++ b/test/prism/snapshots/seattlerb/defn_oneliner.txt
@@ -28,7 +28,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (1,16)-(1,27))
-            │           ├── flags: newline, ignore_visibility
+            │           ├── flags: ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :system
diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt b/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt
index 8d9f6a22..414ecff4 100644
--- a/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt
+++ b/test/prism/snapshots/seattlerb/defn_oneliner_eq2.txt
@@ -42,7 +42,7 @@
             │           │   ├── flags: ∅
             │           │   └── body: (length: 1)
             │           │       └── @ IntegerNode (location: (2,14)-(2,16))
-            │           │           ├── flags: newline, static_literal, decimal
+            │           │           ├── flags: static_literal, decimal
             │           │           └── value: 42
             │           ├── locals: [:o]
             │           ├── def_keyword_loc: (2,2)-(2,5) = "def"
diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_noargs.txt b/test/prism/snapshots/seattlerb/defn_oneliner_noargs.txt
index a7bc11ae..5928f641 100644
--- a/test/prism/snapshots/seattlerb/defn_oneliner_noargs.txt
+++ b/test/prism/snapshots/seattlerb/defn_oneliner_noargs.txt
@@ -16,7 +16,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (1,11)-(1,17))
-            │           ├── flags: newline, variable_call, ignore_visibility
+            │           ├── flags: variable_call, ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :system
diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt b/test/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt
index 174c49d1..d0cd7770 100644
--- a/test/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt
+++ b/test/prism/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt
@@ -16,7 +16,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (1,13)-(1,19))
-            │           ├── flags: newline, variable_call, ignore_visibility
+            │           ├── flags: variable_call, ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :system
diff --git a/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt b/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt
index 5e9c7cce..cc3856aa 100644
--- a/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt
+++ b/test/prism/snapshots/seattlerb/defn_oneliner_rescue.txt
@@ -148,7 +148,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ RescueModifierNode (location: (13,16)-(13,38))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── expression:
             │           │   @ CallNode (location: (13,16)-(13,27))
             │           │   ├── flags: ignore_visibility
diff --git a/test/prism/snapshots/seattlerb/defs_endless_command.txt b/test/prism/snapshots/seattlerb/defs_endless_command.txt
index b1b54229..f34d6679 100644
--- a/test/prism/snapshots/seattlerb/defs_endless_command.txt
+++ b/test/prism/snapshots/seattlerb/defs_endless_command.txt
@@ -26,7 +26,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (1,20)-(1,35))
-            │           ├── flags: newline, ignore_visibility
+            │           ├── flags: ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :other_method
diff --git a/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt b/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt
index e8a7703d..fe859369 100644
--- a/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt
+++ b/test/prism/snapshots/seattlerb/defs_endless_command_rescue.txt
@@ -26,7 +26,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ RescueModifierNode (location: (1,20)-(1,45))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── expression:
             │           │   @ CallNode (location: (1,20)-(1,35))
             │           │   ├── flags: ignore_visibility
diff --git a/test/prism/snapshots/seattlerb/defs_oneliner.txt b/test/prism/snapshots/seattlerb/defs_oneliner.txt
index 4ddde430..c99b8108 100644
--- a/test/prism/snapshots/seattlerb/defs_oneliner.txt
+++ b/test/prism/snapshots/seattlerb/defs_oneliner.txt
@@ -30,7 +30,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (1,21)-(1,32))
-            │           ├── flags: newline, ignore_visibility
+            │           ├── flags: ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :system
diff --git a/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt b/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt
index f51a58e3..328ba5d7 100644
--- a/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt
+++ b/test/prism/snapshots/seattlerb/defs_oneliner_eq2.txt
@@ -44,7 +44,7 @@
             │           │   ├── flags: ∅
             │           │   └── body: (length: 1)
             │           │       └── @ IntegerNode (location: (2,19)-(2,21))
-            │           │           ├── flags: newline, static_literal, decimal
+            │           │           ├── flags: static_literal, decimal
             │           │           └── value: 42
             │           ├── locals: [:o]
             │           ├── def_keyword_loc: (2,2)-(2,5) = "def"
diff --git a/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt b/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt
index 13b91598..2bf97c29 100644
--- a/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt
+++ b/test/prism/snapshots/seattlerb/defs_oneliner_rescue.txt
@@ -154,7 +154,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ RescueModifierNode (location: (13,21)-(13,43))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── expression:
             │           │   @ CallNode (location: (13,21)-(13,32))
             │           │   ├── flags: ignore_visibility
diff --git a/test/prism/snapshots/while.txt b/test/prism/snapshots/while.txt
index c0022eb5..32b22adc 100644
--- a/test/prism/snapshots/while.txt
+++ b/test/prism/snapshots/while.txt
@@ -465,7 +465,7 @@
         │   │   │   ├── flags: ∅
         │   │   │   └── body: (length: 1)
         │   │   │       └── @ CallNode (location: (21,16)-(21,26))
-        │   │   │           ├── flags: newline, ignore_visibility
+        │   │   │           ├── flags: ignore_visibility
         │   │   │           ├── receiver: ∅
         │   │   │           ├── call_operator_loc: ∅
         │   │   │           ├── name: :bar
diff --git a/test/prism/snapshots/whitequark/endless_comparison_method.txt b/test/prism/snapshots/whitequark/endless_comparison_method.txt
index a32a4dff..81fd4a07 100644
--- a/test/prism/snapshots/whitequark/endless_comparison_method.txt
+++ b/test/prism/snapshots/whitequark/endless_comparison_method.txt
@@ -28,7 +28,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (1,16)-(1,28))
-        │   │           ├── flags: newline, variable_call, ignore_visibility
+        │   │           ├── flags: variable_call, ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :do_something
@@ -67,7 +67,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (3,16)-(3,28))
-        │   │           ├── flags: newline, variable_call, ignore_visibility
+        │   │           ├── flags: variable_call, ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :do_something
@@ -106,7 +106,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (5,16)-(5,28))
-        │   │           ├── flags: newline, variable_call, ignore_visibility
+        │   │           ├── flags: variable_call, ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :do_something
@@ -145,7 +145,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (7,16)-(7,28))
-        │   │           ├── flags: newline, variable_call, ignore_visibility
+        │   │           ├── flags: variable_call, ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :do_something
@@ -184,7 +184,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (9,17)-(9,29))
-        │   │           ├── flags: newline, variable_call, ignore_visibility
+        │   │           ├── flags: variable_call, ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :do_something
@@ -223,7 +223,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (11,16)-(11,28))
-            │           ├── flags: newline, variable_call, ignore_visibility
+            │           ├── flags: variable_call, ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :do_something
diff --git a/test/prism/snapshots/whitequark/endless_method.txt b/test/prism/snapshots/whitequark/endless_method.txt
index 5b48a95a..3c24ab2a 100644
--- a/test/prism/snapshots/whitequark/endless_method.txt
+++ b/test/prism/snapshots/whitequark/endless_method.txt
@@ -16,7 +16,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (1,12)-(1,14))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 42
         │   ├── locals: []
         │   ├── def_keyword_loc: (1,0)-(1,3) = "def"
@@ -48,7 +48,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (3,13)-(3,18))
-        │   │           ├── flags: newline
+        │   │           ├── flags: ∅
         │   │           ├── receiver:
         │   │           │   @ LocalVariableReadNode (location: (3,13)-(3,14))
         │   │           │   ├── flags: ∅
@@ -95,7 +95,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (5,16)-(5,18))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 42
         │   ├── locals: []
         │   ├── def_keyword_loc: (5,0)-(5,3) = "def"
@@ -137,7 +137,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (7,17)-(7,22))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── receiver:
             │           │   @ LocalVariableReadNode (location: (7,17)-(7,18))
             │           │   ├── flags: ∅
diff --git a/test/prism/snapshots/whitequark/endless_method_command_syntax.txt b/test/prism/snapshots/whitequark/endless_method_command_syntax.txt
index f2fa941f..db2c0cec 100644
--- a/test/prism/snapshots/whitequark/endless_method_command_syntax.txt
+++ b/test/prism/snapshots/whitequark/endless_method_command_syntax.txt
@@ -16,7 +16,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (1,10)-(1,22))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :puts
@@ -52,7 +52,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (3,12)-(3,24))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :puts
@@ -100,7 +100,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (5,13)-(5,19))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :puts
@@ -144,7 +144,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (7,14)-(7,26))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :puts
@@ -190,7 +190,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (9,16)-(9,28))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :puts
@@ -248,7 +248,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ CallNode (location: (11,17)-(11,23))
-        │   │           ├── flags: newline, ignore_visibility
+        │   │           ├── flags: ignore_visibility
         │   │           ├── receiver: ∅
         │   │           ├── call_operator_loc: ∅
         │   │           ├── name: :puts
@@ -294,7 +294,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ RescueModifierNode (location: (13,17)-(13,60))
-        │   │           ├── flags: newline
+        │   │           ├── flags: ∅
         │   │           ├── expression:
         │   │           │   @ CallNode (location: (13,17)-(13,37))
         │   │           │   ├── flags: ignore_visibility
@@ -372,7 +372,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ RescueModifierNode (location: (15,22)-(15,62))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── expression:
             │           │   @ CallNode (location: (15,22)-(15,42))
             │           │   ├── flags: ignore_visibility
diff --git a/test/prism/snapshots/whitequark/endless_method_forwarded_args_legacy.txt b/test/prism/snapshots/whitequark/endless_method_forwarded_args_legacy.txt
index 67264d3b..5927016b 100644
--- a/test/prism/snapshots/whitequark/endless_method_forwarded_args_legacy.txt
+++ b/test/prism/snapshots/whitequark/endless_method_forwarded_args_legacy.txt
@@ -27,7 +27,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ CallNode (location: (1,15)-(1,23))
-            │           ├── flags: newline, ignore_visibility
+            │           ├── flags: ignore_visibility
             │           ├── receiver: ∅
             │           ├── call_operator_loc: ∅
             │           ├── name: :bar
diff --git a/test/prism/snapshots/whitequark/endless_method_with_rescue_mod.txt b/test/prism/snapshots/whitequark/endless_method_with_rescue_mod.txt
index 54562212..c64ba634 100644
--- a/test/prism/snapshots/whitequark/endless_method_with_rescue_mod.txt
+++ b/test/prism/snapshots/whitequark/endless_method_with_rescue_mod.txt
@@ -16,7 +16,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ RescueModifierNode (location: (1,10)-(1,20))
-        │   │           ├── flags: newline
+        │   │           ├── flags: ∅
         │   │           ├── expression:
         │   │           │   @ IntegerNode (location: (1,10)-(1,11))
         │   │           │   ├── flags: static_literal, decimal
@@ -46,7 +46,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ RescueModifierNode (location: (3,15)-(3,25))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── expression:
             │           │   @ IntegerNode (location: (3,15)-(3,16))
             │           │   ├── flags: static_literal, decimal
diff --git a/test/prism/snapshots/whitequark/endless_method_without_args.txt b/test/prism/snapshots/whitequark/endless_method_without_args.txt
index 2e97f101..0be157df 100644
--- a/test/prism/snapshots/whitequark/endless_method_without_args.txt
+++ b/test/prism/snapshots/whitequark/endless_method_without_args.txt
@@ -16,7 +16,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (1,10)-(1,12))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 42
         │   ├── locals: []
         │   ├── def_keyword_loc: (1,0)-(1,3) = "def"
@@ -36,7 +36,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ RescueModifierNode (location: (3,10)-(3,23))
-        │   │           ├── flags: newline
+        │   │           ├── flags: ∅
         │   │           ├── expression:
         │   │           │   @ IntegerNode (location: (3,10)-(3,12))
         │   │           │   ├── flags: static_literal, decimal
@@ -65,7 +65,7 @@
         │   │   ├── flags: ∅
         │   │   └── body: (length: 1)
         │   │       └── @ IntegerNode (location: (5,15)-(5,17))
-        │   │           ├── flags: newline, static_literal, decimal
+        │   │           ├── flags: static_literal, decimal
         │   │           └── value: 42
         │   ├── locals: []
         │   ├── def_keyword_loc: (5,0)-(5,3) = "def"
@@ -87,7 +87,7 @@
             │   ├── flags: ∅
             │   └── body: (length: 1)
             │       └── @ RescueModifierNode (location: (7,15)-(7,28))
-            │           ├── flags: newline
+            │           ├── flags: ∅
             │           ├── expression:
             │           │   @ IntegerNode (location: (7,15)-(7,17))
             │           │   ├── flags: static_literal, decimal