diff --git a/ruby/ql/test/library-tests/ast/Ast.expected b/ruby/ql/test/library-tests/ast/Ast.expected index e88a3880f1a..0bece506bfb 100644 --- a/ruby/ql/test/library-tests/ast/Ast.expected +++ b/ruby/ql/test/library-tests/ast/Ast.expected @@ -1479,12 +1479,6 @@ control/conditionals.rb: # 88| getStmt: [MethodCall] call to then # 88| getReceiver: [SelfVariableAccess] self # 89| getStmt: [LocalVariableAccess] c -# 94| getStmt: [IfExpr] if ... -# 94| getCondition: [LocalVariableAccess] a -# 94| getBranch/getThen: [StmtSequence] then ... -# 96| getStmt: [MethodCall] call to then -# 96| getReceiver: [SelfVariableAccess] self -# 97| getStmt: [LocalVariableAccess] c # 102| getStmt: [IfExpr] if ... # 102| getCondition: [LocalVariableAccess] a # 102| getBranch/getThen: [StmtSequence] then ... @@ -1502,37 +1496,12 @@ control/conditionals.rb: # 111| getAnOperand/getArgument/getRightOperand: [LocalVariableAccess] c # 111| getBranch/getThen: [StmtSequence] then ... # 113| getStmt: [LocalVariableAccess] d -# 118| getStmt: [IfExpr] if ... -# 118| getCondition: [LogicalAndExpr] ... && ... -# 118| getAnOperand/getLeftOperand/getReceiver: [LocalVariableAccess] a -# 119| getAnOperand/getArgument/getRightOperand: [LocalVariableAccess] b -# 119| getBranch/getThen: [StmtSequence] then ... -# 121| getStmt: [MethodCall] call to then -# 121| getReceiver: [SelfVariableAccess] self -# 122| getStmt: [LocalVariableAccess] d -# 127| getStmt: [IfExpr] if ... -# 127| getCondition: [LogicalAndExpr] ... && ... -# 127| getAnOperand/getLeftOperand/getReceiver: [LocalVariableAccess] a -# 128| getAnOperand/getArgument/getRightOperand: [ParenthesizedExpr] ( ... ) -# 128| getStmt: [LocalVariableAccess] b -# 129| getBranch/getThen: [StmtSequence] then ... -# 131| getStmt: [LocalVariableAccess] d -# 136| getStmt: [IfExpr] if ... -# 136| getCondition: [LocalVariableAccess] a -# 136| getBranch/getThen: [StmtSequence] then ... -# 139| getStmt: [MethodCall] call to then -# 139| getReceiver: [SelfVariableAccess] self -# 140| getStmt: [LocalVariableAccess] d # 144| getStmt: [IfExpr] if ... # 144| getCondition: [LogicalAndExpr] ... && ... # 144| getAnOperand/getLeftOperand/getReceiver: [LocalVariableAccess] a # 145| getAnOperand/getArgument/getRightOperand: [LocalVariableAccess] b # 145| getBranch/getThen: [StmtSequence] then ... # 147| getStmt: [LocalVariableAccess] c -# 137| [ParenthesizedExpr] ( ... ) -# 137| getStmt: [LogicalAndExpr] ... && ... -# 137| getAnOperand/getLeftOperand/getReceiver: [MethodCall] call to b -# 138| getAnOperand/getArgument/getRightOperand: [MethodCall] call to c constants/constants.rb: # 1| [Toplevel] constants.rb # 1| getStmt: [ModuleDeclaration] ModuleA @@ -2925,9 +2894,6 @@ operations/operations.rb: # 88| getAnOperand/getRightOperand: [LogicalAndExpr] ... && ... # 88| getAnOperand/getLeftOperand/getReceiver: [LocalVariableAccess] a # 89| getAnOperand/getArgument/getRightOperand: [LocalVariableAccess] b -# 91| getStmt: [AssignExpr] ... = ... -# 91| getAnOperand/getLeftOperand: [LocalVariableAccess] bar -# 91| getAnOperand/getRightOperand: [LocalVariableAccess] a # 95| getStmt: [Method] foo # 95| getParameter: [SimpleParameter] a # 95| getDefiningAccess: [LocalVariableAccess] a @@ -2937,13 +2903,6 @@ operations/operations.rb: # 96| getValue: [LogicalAndExpr] ... && ... # 96| getAnOperand/getLeftOperand/getReceiver: [LocalVariableAccess] a # 97| getAnOperand/getArgument/getRightOperand: [LocalVariableAccess] b -# 102| getStmt: [Method] bar -# 102| getParameter: [SimpleParameter] a -# 102| getDefiningAccess: [LocalVariableAccess] a -# 102| getParameter: [SimpleParameter] b -# 102| getDefiningAccess: [LocalVariableAccess] b -# 103| getStmt: [ReturnStmt] return -# 103| getValue: [LocalVariableAccess] a # 107| getStmt: [ClassDeclaration] X # 108| getStmt: [AssignExpr] ... = ... # 108| getAnOperand/getLeftOperand: [InstanceVariableAccess] @x diff --git a/ruby/ql/test/library-tests/ast/TreeSitter.expected b/ruby/ql/test/library-tests/ast/TreeSitter.expected index 854b5e1f10b..ab7937969d1 100644 --- a/ruby/ql/test/library-tests/ast/TreeSitter.expected +++ b/ruby/ql/test/library-tests/ast/TreeSitter.expected @@ -2993,14 +2993,7 @@ control/conditionals.rb: # 88| 1: [Identifier] then # 89| 2: [Identifier] c # 90| 3: [ReservedWord] end -# 94| 20: [If] If -# 94| 0: [ReservedWord] if -# 94| 1: [Identifier] a -# 94| 2: [Then] Then -# 96| 1: [Identifier] then -# 97| 2: [Identifier] c -# 98| 3: [ReservedWord] end -# 102| 21: [If] If +# 102| 20: [If] If # 102| 0: [ReservedWord] if # 102| 1: [Identifier] a # 102| 2: [Then] Then @@ -3011,7 +3004,7 @@ control/conditionals.rb: # 104| 1: [Identifier] then # 105| 2: [Identifier] c # 106| 3: [ReservedWord] end -# 109| 22: [If] If +# 109| 21: [If] If # 109| 0: [ReservedWord] if # 109| 1: [Binary] Binary # 109| 0: [Binary] Binary @@ -3024,37 +3017,7 @@ control/conditionals.rb: # 112| 0: [ReservedWord] then # 113| 1: [Identifier] d # 114| 3: [ReservedWord] end -# 118| 23: [If] If -# 118| 0: [ReservedWord] if -# 118| 1: [Binary] Binary -# 118| 0: [Identifier] a -# 119| 1: [ReservedWord] && -# 119| 2: [Identifier] b -# 119| 2: [Then] Then -# 121| 1: [Identifier] then -# 122| 2: [Identifier] d -# 123| 3: [ReservedWord] end -# 127| 24: [If] If -# 127| 0: [ReservedWord] if -# 127| 1: [Binary] Binary -# 127| 0: [Identifier] a -# 128| 1: [ReservedWord] && -# 128| 2: [ParenthesizedStatements] ParenthesizedStatements -# 128| 0: [ReservedWord] ( -# 128| 1: [Identifier] b -# 129| 3: [ReservedWord] ) -# 129| 2: [Then] Then -# 130| 0: [ReservedWord] then -# 131| 1: [Identifier] d -# 132| 3: [ReservedWord] end -# 136| 25: [If] If -# 136| 0: [ReservedWord] if -# 136| 1: [Identifier] a -# 136| 2: [Then] Then -# 139| 1: [Identifier] then -# 140| 2: [Identifier] d -# 141| 3: [ReservedWord] end -# 144| 26: [If] If +# 144| 22: [If] If # 144| 0: [ReservedWord] if # 144| 1: [Binary] Binary # 144| 0: [Identifier] a @@ -3082,29 +3045,38 @@ control/conditionals.rb: # 85| [Comment] # NOTE: This is not parsed correctly, `and b` is parsed as a call # 92| [Comment] # If expr with `||` at the start of a separate line before then # 93| [Comment] # NOTE: This is not parsed correctly due to the leading `||` -# 95| [ReservedWord] || -# 95| [Identifier] b +# 94| [Comment] # if a +# 95| [Comment] # || b +# 96| [Comment] # then +# 97| [Comment] # c +# 98| [Comment] # end # 100| [Comment] # If expr with `or` at the start of a separate line before then # 101| [Comment] # NOTE: This is not parsed correctly, `or b` is parsed as a call # 108| [Comment] # If expr with repeated && at the start of a separate line before then # 116| [Comment] # If expr with alternating && and || at the start of lines # 117| [Comment] # NOTE: This is not parsed correctly due to the leading `||` -# 120| [ReservedWord] || -# 120| [Identifier] c +# 118| [Comment] # if a +# 119| [Comment] # && b +# 120| [Comment] # || c +# 121| [Comment] # then +# 122| [Comment] # d +# 123| [Comment] # end # 125| [Comment] # If expr with operator at start of line and parentheses # 126| [Comment] # NOTE: This is not parsed correctly due to the leading `||` -# 129| [ReservedWord] || -# 129| [Identifier] c +# 127| [Comment] # if a +# 128| [Comment] # && (b +# 129| [Comment] # || c) +# 130| [Comment] # then +# 131| [Comment] # d +# 132| [Comment] # end # 134| [Comment] # If expr with operator at start of line and parentheses # 135| [Comment] # NOTE: This is not parsed correctly due to the leading `||` -# 137| [ReservedWord] || -# 137| [ParenthesizedStatements] ParenthesizedStatements -# 137| 0: [ReservedWord] ( -# 137| 1: [Binary] Binary -# 137| 0: [Identifier] b -# 138| 1: [ReservedWord] && -# 138| 2: [Identifier] c -# 138| 2: [ReservedWord] ) +# 136| [Comment] # if a +# 137| [Comment] # || (b +# 138| [Comment] # && c) +# 139| [Comment] # then +# 140| [Comment] # d +# 141| [Comment] # end # 143| [Comment] # If expr with && at end of line control/loops.rb: # 1| [Program] Program @@ -5703,11 +5675,7 @@ operations/operations.rb: # 88| 0: [Identifier] a # 89| 1: [ReservedWord] && # 89| 2: [Identifier] b -# 91| 64: [Assignment] Assignment -# 91| 0: [Identifier] bar -# 91| 1: [ReservedWord] = -# 91| 2: [Identifier] a -# 95| 66: [Method] Method +# 95| 64: [Method] Method # 95| 0: [ReservedWord] def # 95| 1: [Identifier] foo # 95| 2: [MethodParameters] MethodParameters @@ -5725,22 +5693,7 @@ operations/operations.rb: # 97| 1: [ReservedWord] && # 97| 2: [Identifier] b # 98| 4: [ReservedWord] end -# 102| 67: [Method] Method -# 102| 0: [ReservedWord] def -# 102| 1: [Identifier] bar -# 102| 2: [MethodParameters] MethodParameters -# 102| 0: [ReservedWord] ( -# 102| 1: [Identifier] a -# 102| 2: [ReservedWord] , -# 102| 3: [Identifier] b -# 102| 4: [ReservedWord] ) -# 103| 3: [BodyStatement] BodyStatement -# 103| 0: [Return] Return -# 103| 0: [ReservedWord] return -# 103| 1: [ArgumentList] ArgumentList -# 103| 0: [Identifier] a -# 105| 4: [ReservedWord] end -# 107| 68: [Class] Class +# 107| 65: [Class] Class # 107| 0: [ReservedWord] class # 107| 1: [Constant] X # 108| 2: [BodyStatement] BodyStatement @@ -5761,34 +5714,34 @@ operations/operations.rb: # 112| 1: [ReservedWord] /= # 112| 2: [Integer] 4 # 113| 3: [ReservedWord] end -# 115| 69: [Assignment] Assignment +# 115| 66: [Assignment] Assignment # 115| 0: [GlobalVariable] $global_var # 115| 1: [ReservedWord] = # 115| 2: [Integer] 5 -# 116| 70: [OperatorAssignment] OperatorAssignment +# 116| 67: [OperatorAssignment] OperatorAssignment # 116| 0: [GlobalVariable] $global_var # 116| 1: [ReservedWord] *= # 116| 2: [Integer] 6 -# 118| 71: [Assignment] Assignment +# 118| 68: [Assignment] Assignment # 118| 0: [Constant] CONSTANT1 # 118| 1: [ReservedWord] = # 118| 2: [Integer] 5 -# 119| 72: [OperatorAssignment] OperatorAssignment +# 119| 69: [OperatorAssignment] OperatorAssignment # 119| 0: [Constant] CONSTANT2 # 119| 1: [ReservedWord] += # 119| 2: [Integer] 6 -# 120| 73: [OperatorAssignment] OperatorAssignment +# 120| 70: [OperatorAssignment] OperatorAssignment # 120| 0: [Constant] CONSTANT3 # 120| 1: [ReservedWord] ||= # 120| 2: [Integer] 7 -# 121| 74: [OperatorAssignment] OperatorAssignment +# 121| 71: [OperatorAssignment] OperatorAssignment # 121| 0: [ScopeResolution] ScopeResolution # 121| 0: [Constant] Foo # 121| 1: [ReservedWord] :: # 121| 2: [Constant] MemberConstant # 121| 1: [ReservedWord] ||= # 121| 2: [Integer] 8 -# 122| 75: [OperatorAssignment] OperatorAssignment +# 122| 72: [OperatorAssignment] OperatorAssignment # 122| 0: [ScopeResolution] ScopeResolution # 122| 0: [Call] Call # 122| 0: [Call] Call @@ -5803,13 +5756,13 @@ operations/operations.rb: # 122| 2: [Constant] OtherConstant # 122| 1: [ReservedWord] ||= # 122| 2: [Integer] 7 -# 123| 76: [OperatorAssignment] OperatorAssignment +# 123| 73: [OperatorAssignment] OperatorAssignment # 123| 0: [ScopeResolution] ScopeResolution # 123| 0: [ReservedWord] :: # 123| 1: [Constant] CONSTANT4 # 123| 1: [ReservedWord] ||= # 123| 2: [Integer] 7 -# 124| 77: [Assignment] Assignment +# 124| 74: [Assignment] Assignment # 124| 0: [LeftAssignmentList] LeftAssignmentList # 124| 0: [Constant] FOO # 124| 1: [ReservedWord] , @@ -5830,7 +5783,7 @@ operations/operations.rb: # 124| 4: [ReservedWord] , # 124| 5: [Integer] 3 # 124| 6: [ReservedWord] ] -# 126| 78: [Binary] Binary +# 126| 75: [Binary] Binary # 126| 0: [Identifier] foo # 126| 1: [ReservedWord] / # 127| 2: [Integer] 5 @@ -5848,13 +5801,15 @@ operations/operations.rb: # 80| [Comment] # Bitwise assign operations # 87| [Comment] # Assignments with operation at start of line # 90| [Comment] # NOTE: This is not parsed correctly, `|| b` is dropped -# 92| [ReservedWord] || -# 92| [Identifier] b +# 91| [Comment] # bar = a +# 92| [Comment] # || b # 94| [Comment] # Return with `&&` at start of line # 100| [Comment] # Return with `||` at start of line # 101| [Comment] # NOTE: This is not parsed correctly, `|| b` is dropped -# 104| [ReservedWord] || -# 104| [Identifier] b +# 102| [Comment] # def bar(a, b) +# 103| [Comment] # return a +# 104| [Comment] # || b +# 105| [Comment] # end params/params.rb: # 1| [Program] Program # 4| 0: [Method] Method diff --git a/ruby/ql/test/library-tests/ast/ValueText.expected b/ruby/ql/test/library-tests/ast/ValueText.expected index 49122cb6ed0..e0ad853ba83 100644 --- a/ruby/ql/test/library-tests/ast/ValueText.expected +++ b/ruby/ql/test/library-tests/ast/ValueText.expected @@ -347,9 +347,6 @@ exprValue | control/conditionals.rb:110:8:110:8 | b | 0 | int | | control/conditionals.rb:111:8:111:8 | c | 0 | int | | control/conditionals.rb:113:5:113:5 | d | 0 | int | -| control/conditionals.rb:119:6:119:6 | b | 0 | int | -| control/conditionals.rb:128:7:128:7 | b | 0 | int | -| control/conditionals.rb:131:5:131:5 | d | 0 | int | | control/conditionals.rb:145:5:145:5 | b | 0 | int | | control/conditionals.rb:147:5:147:5 | c | 0 | int | | control/loops.rb:2:7:2:7 | 0 | 0 | int | @@ -1285,9 +1282,6 @@ exprCfgNodeValue | control/conditionals.rb:110:8:110:8 | b | 0 | int | | control/conditionals.rb:111:8:111:8 | c | 0 | int | | control/conditionals.rb:113:5:113:5 | d | 0 | int | -| control/conditionals.rb:119:6:119:6 | b | 0 | int | -| control/conditionals.rb:128:7:128:7 | b | 0 | int | -| control/conditionals.rb:131:5:131:5 | d | 0 | int | | control/conditionals.rb:145:5:145:5 | b | 0 | int | | control/conditionals.rb:147:5:147:5 | c | 0 | int | | control/loops.rb:2:7:2:7 | 0 | 0 | int | @@ -1862,6 +1856,26 @@ exprCfgNodeValue | operations/operations.rb:85:2:85:4 | baz | 0 | int | | operations/operations.rb:85:9:85:11 | qux | 0 | int | | operations/operations.rb:89:6:89:6 | b | 0 | int | +| operations/operations.rb:108:8:108:8 | 1 | 1 | int | +| operations/operations.rb:109:9:109:9 | 2 | 2 | int | +| operations/operations.rb:111:9:111:9 | 3 | 3 | int | +| operations/operations.rb:112:10:112:10 | 4 | 4 | int | +| operations/operations.rb:115:15:115:15 | 5 | 5 | int | +| operations/operations.rb:116:16:116:16 | 6 | 6 | int | +| operations/operations.rb:118:13:118:13 | 5 | 5 | int | +| operations/operations.rb:119:14:119:14 | 6 | 6 | int | +| operations/operations.rb:120:15:120:15 | 7 | 7 | int | +| operations/operations.rb:121:25:121:25 | 8 | 8 | int | +| operations/operations.rb:122:5:122:5 | 1 | 1 | int | +| operations/operations.rb:122:31:122:31 | 7 | 7 | int | +| operations/operations.rb:123:17:123:17 | 7 | 7 | int | +| operations/operations.rb:124:1:124:3 | 0 | 0 | int | +| operations/operations.rb:124:6:124:10 | 1 | 1 | int | +| operations/operations.rb:124:13:124:20 | 2 | 2 | int | +| operations/operations.rb:124:25:124:25 | 1 | 1 | int | +| operations/operations.rb:124:28:124:28 | 2 | 2 | int | +| operations/operations.rb:124:31:124:31 | 3 | 3 | int | +| operations/operations.rb:127:1:127:1 | 5 | 5 | int | | params/params.rb:41:46:41:46 | 7 | 7 | int | | params/params.rb:47:19:47:21 | :bar | :bar | symbol | | params/params.rb:47:24:47:24 | 2 | 2 | int | diff --git a/ruby/ql/test/library-tests/ast/control/ConditionalExpr.expected b/ruby/ql/test/library-tests/ast/control/ConditionalExpr.expected index da3cb1a9519..b2817b6feda 100644 --- a/ruby/ql/test/library-tests/ast/control/ConditionalExpr.expected +++ b/ruby/ql/test/library-tests/ast/control/ConditionalExpr.expected @@ -25,12 +25,8 @@ conditionalExprs | conditionals.rb:73:1:75:3 | if ... | IfExpr | conditionals.rb:73:4:73:9 | ... && ... | conditionals.rb:73:11:74:5 | then ... | true | | conditionals.rb:78:1:82:3 | if ... | IfExpr | conditionals.rb:78:4:79:8 | ... && ... | conditionals.rb:79:9:81:5 | then ... | true | | conditionals.rb:86:1:90:3 | if ... | IfExpr | conditionals.rb:86:4:86:4 | a | conditionals.rb:86:5:89:5 | then ... | true | -| conditionals.rb:94:1:98:3 | if ... | IfExpr | conditionals.rb:94:4:94:4 | a | conditionals.rb:94:5:97:5 | then ... | true | | conditionals.rb:102:1:106:3 | if ... | IfExpr | conditionals.rb:102:4:102:4 | a | conditionals.rb:102:5:105:5 | then ... | true | | conditionals.rb:109:1:114:3 | if ... | IfExpr | conditionals.rb:109:4:111:8 | ... && ... | conditionals.rb:111:9:113:5 | then ... | true | -| conditionals.rb:118:1:123:3 | if ... | IfExpr | conditionals.rb:118:4:119:6 | ... && ... | conditionals.rb:119:7:122:5 | then ... | true | -| conditionals.rb:127:1:132:3 | if ... | IfExpr | conditionals.rb:127:4:129:7 | ... && ... | conditionals.rb:129:8:131:5 | then ... | true | -| conditionals.rb:136:1:141:3 | if ... | IfExpr | conditionals.rb:136:4:136:4 | a | conditionals.rb:136:5:140:5 | then ... | true | | conditionals.rb:144:1:148:3 | if ... | IfExpr | conditionals.rb:144:4:145:5 | ... && ... | conditionals.rb:145:6:147:5 | then ... | true | | loops.rb:9:5:9:5 | if ... | IfExpr | loops.rb:9:5:9:5 | ! ... | loops.rb:9:5:9:5 | ... = ... | true | | loops.rb:16:5:16:5 | if ... | IfExpr | loops.rb:16:5:16:5 | ! ... | loops.rb:16:5:16:5 | ... = ... | true | @@ -51,12 +47,8 @@ ifExprs | conditionals.rb:73:1:75:3 | if ... | IfExpr | conditionals.rb:73:4:73:9 | ... && ... | conditionals.rb:73:11:74:5 | then ... | (none) | false | | conditionals.rb:78:1:82:3 | if ... | IfExpr | conditionals.rb:78:4:79:8 | ... && ... | conditionals.rb:79:9:81:5 | then ... | (none) | false | | conditionals.rb:86:1:90:3 | if ... | IfExpr | conditionals.rb:86:4:86:4 | a | conditionals.rb:86:5:89:5 | then ... | (none) | false | -| conditionals.rb:94:1:98:3 | if ... | IfExpr | conditionals.rb:94:4:94:4 | a | conditionals.rb:94:5:97:5 | then ... | (none) | false | | conditionals.rb:102:1:106:3 | if ... | IfExpr | conditionals.rb:102:4:102:4 | a | conditionals.rb:102:5:105:5 | then ... | (none) | false | | conditionals.rb:109:1:114:3 | if ... | IfExpr | conditionals.rb:109:4:111:8 | ... && ... | conditionals.rb:111:9:113:5 | then ... | (none) | false | -| conditionals.rb:118:1:123:3 | if ... | IfExpr | conditionals.rb:118:4:119:6 | ... && ... | conditionals.rb:119:7:122:5 | then ... | (none) | false | -| conditionals.rb:127:1:132:3 | if ... | IfExpr | conditionals.rb:127:4:129:7 | ... && ... | conditionals.rb:129:8:131:5 | then ... | (none) | false | -| conditionals.rb:136:1:141:3 | if ... | IfExpr | conditionals.rb:136:4:136:4 | a | conditionals.rb:136:5:140:5 | then ... | (none) | false | | conditionals.rb:144:1:148:3 | if ... | IfExpr | conditionals.rb:144:4:145:5 | ... && ... | conditionals.rb:145:6:147:5 | then ... | (none) | false | unlessExprs | conditionals.rb:40:1:42:3 | unless ... | UnlessExpr | conditionals.rb:40:8:40:12 | ... > ... | conditionals.rb:40:14:41:5 | then ... | (none) | diff --git a/ruby/ql/test/library-tests/ast/control/ControlExpr.expected b/ruby/ql/test/library-tests/ast/control/ControlExpr.expected index 1c57fb080ee..e84d2608249 100644 --- a/ruby/ql/test/library-tests/ast/control/ControlExpr.expected +++ b/ruby/ql/test/library-tests/ast/control/ControlExpr.expected @@ -31,12 +31,8 @@ | conditionals.rb:73:1:75:3 | if ... | IfExpr | | conditionals.rb:78:1:82:3 | if ... | IfExpr | | conditionals.rb:86:1:90:3 | if ... | IfExpr | -| conditionals.rb:94:1:98:3 | if ... | IfExpr | | conditionals.rb:102:1:106:3 | if ... | IfExpr | | conditionals.rb:109:1:114:3 | if ... | IfExpr | -| conditionals.rb:118:1:123:3 | if ... | IfExpr | -| conditionals.rb:127:1:132:3 | if ... | IfExpr | -| conditionals.rb:136:1:141:3 | if ... | IfExpr | | conditionals.rb:144:1:148:3 | if ... | IfExpr | | loops.rb:9:1:12:3 | for ... in ... | ForExpr | | loops.rb:9:5:9:5 | if ... | IfExpr | diff --git a/ruby/ql/test/library-tests/ast/control/conditionals.rb b/ruby/ql/test/library-tests/ast/control/conditionals.rb index 4cbaf25b71c..b5c63afbc81 100644 --- a/ruby/ql/test/library-tests/ast/control/conditionals.rb +++ b/ruby/ql/test/library-tests/ast/control/conditionals.rb @@ -91,11 +91,11 @@ end # If expr with `||` at the start of a separate line before then # NOTE: This is not parsed correctly due to the leading `||` -if a - || b -then - c -end +# if a +# || b +# then +# c +# end # If expr with `or` at the start of a separate line before then # NOTE: This is not parsed correctly, `or b` is parsed as a call @@ -115,30 +115,30 @@ end # If expr with alternating && and || at the start of lines # NOTE: This is not parsed correctly due to the leading `||` -if a - && b - || c -then - d -end +# if a +# && b +# || c +# then +# d +# end # If expr with operator at start of line and parentheses # NOTE: This is not parsed correctly due to the leading `||` -if a - && (b - || c) -then - d -end +# if a +# && (b +# || c) +# then +# d +# end # If expr with operator at start of line and parentheses # NOTE: This is not parsed correctly due to the leading `||` -if a - || (b - && c) -then - d -end +# if a +# || (b +# && c) +# then +# d +# end # If expr with && at end of line if a && diff --git a/ruby/ql/test/library-tests/ast/operations/assignment.expected b/ruby/ql/test/library-tests/ast/operations/assignment.expected index e03066597b2..54f6a0c00fa 100644 --- a/ruby/ql/test/library-tests/ast/operations/assignment.expected +++ b/ruby/ql/test/library-tests/ast/operations/assignment.expected @@ -44,7 +44,6 @@ assignments | operations.rb:85:2:85:11 | ... = ... | = | operations.rb:85:2:85:4 | baz | operations.rb:85:6:85:7 | ... ^ ... | AssignExpr | | operations.rb:85:2:85:11 | ... ^= ... | ^= | operations.rb:85:2:85:4 | baz | operations.rb:85:9:85:11 | qux | AssignBitwiseXorExpr | | operations.rb:88:1:89:6 | ... = ... | = | operations.rb:88:1:88:3 | foo | operations.rb:88:7:89:6 | ... && ... | AssignExpr | -| operations.rb:91:1:91:7 | ... = ... | = | operations.rb:91:1:91:3 | bar | operations.rb:91:7:91:7 | a | AssignExpr | | operations.rb:108:3:108:8 | ... = ... | = | operations.rb:108:3:108:4 | @x | operations.rb:108:8:108:8 | 1 | AssignExpr | | operations.rb:109:3:109:9 | ... += ... | += | operations.rb:109:3:109:4 | @x | operations.rb:109:9:109:9 | 2 | AssignAddExpr | | operations.rb:109:3:109:9 | ... = ... | = | operations.rb:109:3:109:4 | @x | operations.rb:109:6:109:7 | ... + ... | AssignExpr | diff --git a/ruby/ql/test/library-tests/ast/operations/operation.expected b/ruby/ql/test/library-tests/ast/operations/operation.expected index ffc123b7907..7f7833f707d 100644 --- a/ruby/ql/test/library-tests/ast/operations/operation.expected +++ b/ruby/ql/test/library-tests/ast/operations/operation.expected @@ -174,8 +174,6 @@ | operations.rb:88:1:89:6 | ... = ... | = | operations.rb:88:7:89:6 | ... && ... | AssignExpr | | operations.rb:88:7:89:6 | ... && ... | && | operations.rb:88:7:88:7 | a | LogicalAndExpr | | operations.rb:88:7:89:6 | ... && ... | && | operations.rb:89:6:89:6 | b | LogicalAndExpr | -| operations.rb:91:1:91:7 | ... = ... | = | operations.rb:91:1:91:3 | bar | AssignExpr | -| operations.rb:91:1:91:7 | ... = ... | = | operations.rb:91:7:91:7 | a | AssignExpr | | operations.rb:96:10:97:8 | ... && ... | && | operations.rb:96:10:96:10 | a | LogicalAndExpr | | operations.rb:96:10:97:8 | ... && ... | && | operations.rb:97:8:97:8 | b | LogicalAndExpr | | operations.rb:108:3:108:8 | ... = ... | = | operations.rb:108:3:108:4 | @x | AssignExpr | diff --git a/ruby/ql/test/library-tests/ast/operations/operations.rb b/ruby/ql/test/library-tests/ast/operations/operations.rb index fa7cb985251..93ddc39d638 100644 --- a/ruby/ql/test/library-tests/ast/operations/operations.rb +++ b/ruby/ql/test/library-tests/ast/operations/operations.rb @@ -88,8 +88,8 @@ foo **= bar foo = a && b # NOTE: This is not parsed correctly, `|| b` is dropped -bar = a - || b +# bar = a +# || b # Return with `&&` at start of line def foo(a, b) @@ -99,10 +99,10 @@ end # Return with `||` at start of line # NOTE: This is not parsed correctly, `|| b` is dropped -def bar(a, b) - return a - || b -end +# def bar(a, b) +# return a +# || b +# end class X @x = 1