Ruby: add AST classes for parenthesized patterns

This commit is contained in:
Arthur Baars
2021-12-03 18:13:53 +01:00
parent 205233b42f
commit 51998294ad
8 changed files with 170 additions and 124 deletions

View File

@@ -100,7 +100,7 @@ class TuplePattern extends Pattern, TTuplePattern {
private class TPatternNode =
TArrayPattern or TFindPattern or THashPattern or TAlternativePattern or TAsPattern or
TVariableReferencePattern;
TParenthesizedPattern or TVariableReferencePattern;
private class TPattern =
TPatternNode or TLiteral or TLambda or TConstantAccess or TLocalVariableAccess or
@@ -389,6 +389,30 @@ class AsPattern extends CasePattern, TAsPattern {
}
}
/**
* A parenthesized pattern:
* ```rb
* in (1 ..)
* in (0 | "" | [] | {})
*/
class ParenthesizedPattern extends CasePattern, TParenthesizedPattern {
private Ruby::ParenthesizedPattern g;
ParenthesizedPattern() { this = TParenthesizedPattern(g) }
final CasePattern getPattern() { toGenerated(result) = g.getChild() }
final override string getAPrimaryQlClass() { result = "ParenthesizedPattern" }
final override string toString() { result = "( ... )" }
final override AstNode getAChild(string pred) {
result = super.getAChild(pred)
or
pred = "getPattern" and result = this.getPattern()
}
}
/**
* A variable reference in a pattern, i.e. `^x` in the following example:
* ```rb

View File

@@ -216,6 +216,7 @@ private module Cached {
TOptionalParameter(Ruby::OptionalParameter g) or
TPair(Ruby::Pair g) or
TParenthesizedExpr(Ruby::ParenthesizedStatements g) or
TParenthesizedPattern(Ruby::ParenthesizedPattern g) or
TRShiftExprReal(Ruby::Binary g) { g instanceof @ruby_binary_ranglerangle } or
TRShiftExprSynth(AST::AstNode parent, int i) { mkSynthChild(RShiftExprKind(), parent, i) } or
TRangeLiteralReal(Ruby::Range g) or
@@ -335,10 +336,10 @@ private module Cached {
TLeftAssignmentList or TLine or TLocalVariableAccessReal or TLogicalAndExprReal or
TLogicalOrExprReal or TMethod or TModuleDeclaration or TModuloExprReal or TMulExprReal or
TNEExpr or TNextStmt or TNilLiteral or TNoRegExpMatchExpr or TNotExpr or
TOptionalParameter or TPair or TParenthesizedExpr or TRShiftExprReal or TRangeLiteralReal or
TRationalLiteral or TRedoStmt or TRegExpLiteral or TRegExpMatchExpr or
TRegularArrayLiteral or TRegularMethodCall or TRegularStringLiteral or TRegularSuperCall or
TRescueClause or TRescueModifierExpr or TRetryStmt or TReturnStmt or
TOptionalParameter or TPair or TParenthesizedExpr or TParenthesizedPattern or
TRShiftExprReal or TRangeLiteralReal or TRationalLiteral or TRedoStmt or TRegExpLiteral or
TRegExpMatchExpr or TRegularArrayLiteral or TRegularMethodCall or TRegularStringLiteral or
TRegularSuperCall or TRescueClause or TRescueModifierExpr or TRetryStmt or TReturnStmt or
TScopeResolutionConstantAccess or TScopeResolutionMethodCall or TSelfReal or
TSimpleParameterReal or TSimpleSymbolLiteral or TSingletonClass or TSingletonMethod or
TSpaceshipExpr or TSplatExprReal or TSplatParameter or TStringArrayLiteral or
@@ -465,6 +466,7 @@ private module Cached {
n = TOptionalParameter(result) or
n = TPair(result) or
n = TParenthesizedExpr(result) or
n = TParenthesizedPattern(result) or
n = TRangeLiteralReal(result) or
n = TRationalLiteral(result) or
n = TRedoStmt(result) or

View File

@@ -46,6 +46,8 @@ predicate casePattern(Ruby::AstNode node) {
node = any(Ruby::AsPattern parent).getValue()
or
node = any(Ruby::KeywordPattern parent).getValue()
or
node = any(Ruby::ParenthesizedPattern parent).getChild()
}
/**

View File

@@ -1005,90 +1005,101 @@ control/cases.rb:
# 106| getAnOperand/getOperand/getReceiver: [IntegerLiteral] 5
# 106| getAlternative: [UnaryPlusExpr] + ...
# 106| getAnOperand/getOperand/getReceiver: [IntegerLiteral] 10
# 111| getStmt: [CaseExpr] case ...
# 111| getValue: [MethodCall] call to expr
# 111| getReceiver: [Self, SelfVariableAccess] self
# 112| getBranch: [InClause] in ... then ...
# 112| getPattern: [ArrayPattern] [ ..., * ]
# 113| getBranch: [InClause] in ... then ...
# 113| getPattern: [ArrayPattern] [ ..., * ]
# 113| getPrefixElement: [LocalVariableAccess] x
# 107| getBranch: [InClause] in ... then ...
# 107| getPattern: [ParenthesizedPattern] ( ... )
# 107| getPattern: [RangeLiteral] _ .. _
# 107| getBegin: [IntegerLiteral] 1
# 108| getBranch: [InClause] in ... then ...
# 108| getPattern: [ParenthesizedPattern] ( ... )
# 108| getPattern: [AlternativePattern] ... | ...
# 108| getAlternative: [IntegerLiteral] 0
# 108| getAlternative: [StringLiteral] ""
# 108| getAlternative: [ArrayPattern] [ ..., * ]
# 108| getAlternative: [HashPattern] { ..., ** }
# 113| getStmt: [CaseExpr] case ...
# 113| getValue: [MethodCall] call to expr
# 113| getReceiver: [Self, SelfVariableAccess] self
# 114| getBranch: [InClause] in ... then ...
# 114| getPattern: [ArrayPattern] [ ..., * ]
# 114| getPrefixElement/getSuffixElement: [LocalVariableAccess] x
# 115| getBranch: [InClause] in ... then ...
# 115| getPattern: [ArrayPattern] [ ..., * ]
# 115| getClass: [ConstantReadAccess] Bar
# 115| getScopeExpr: [ConstantReadAccess] Foo
# 115| getPrefixElement: [LocalVariableAccess] x
# 116| getBranch: [InClause] in ... then ...
# 116| getPattern: [ArrayPattern] [ ..., * ]
# 116| getClass: [ConstantReadAccess] Foo
# 116| getPrefixElement/getSuffixElement: [LocalVariableAccess] x
# 117| getBranch: [InClause] in ... then ...
# 117| getPattern: [ArrayPattern] [ ..., * ]
# 117| getClass: [ConstantReadAccess] Bar
# 117| getScopeExpr: [ConstantReadAccess] Foo
# 118| getBranch: [InClause] in ... then ...
# 118| getPattern: [ArrayPattern] [ ..., * ]
# 118| getClass: [ConstantReadAccess] Bar
# 118| getPrefixElement/getSuffixElement: [LocalVariableAccess] a
# 118| getPrefixElement/getSuffixElement: [LocalVariableAccess] b
# 118| getRestVariableAccess: [LocalVariableAccess] c
# 118| getSuffixElement: [LocalVariableAccess] d
# 118| getSuffixElement: [LocalVariableAccess] e
# 123| getStmt: [CaseExpr] case ...
# 123| getValue: [MethodCall] call to expr
# 123| getReceiver: [Self, SelfVariableAccess] self
# 124| getBranch: [InClause] in ... then ...
# 124| getPattern: [FindPattern] [ *,...,* ]
# 124| getElement: [LocalVariableAccess] x
# 125| getBranch: [InClause] in ... then ...
# 125| getPattern: [FindPattern] [ *,...,* ]
# 125| getPrefixVariableAccess: [LocalVariableAccess] x
# 125| getElement: [IntegerLiteral] 1
# 125| getElement: [IntegerLiteral] 2
# 125| getSuffixVariableAccess: [LocalVariableAccess] y
# 118| getClass: [ConstantReadAccess] Foo
# 119| getBranch: [InClause] in ... then ...
# 119| getPattern: [ArrayPattern] [ ..., * ]
# 119| getClass: [ConstantReadAccess] Bar
# 120| getBranch: [InClause] in ... then ...
# 120| getPattern: [ArrayPattern] [ ..., * ]
# 120| getClass: [ConstantReadAccess] Bar
# 120| getPrefixElement/getSuffixElement: [LocalVariableAccess] a
# 120| getPrefixElement/getSuffixElement: [LocalVariableAccess] b
# 120| getRestVariableAccess: [LocalVariableAccess] c
# 120| getSuffixElement: [LocalVariableAccess] d
# 120| getSuffixElement: [LocalVariableAccess] e
# 125| getStmt: [CaseExpr] case ...
# 125| getValue: [MethodCall] call to expr
# 125| getReceiver: [Self, SelfVariableAccess] self
# 126| getBranch: [InClause] in ... then ...
# 126| getPattern: [FindPattern] [ *,...,* ]
# 126| getClass: [ConstantReadAccess] Bar
# 126| getScopeExpr: [ConstantReadAccess] Foo
# 126| getElement: [IntegerLiteral] 1
# 126| getElement: [LocalVariableAccess] x
# 127| getBranch: [InClause] in ... then ...
# 127| getPattern: [FindPattern] [ *,...,* ]
# 127| getClass: [ConstantReadAccess] Foo
# 127| getElement: [ConstantReadAccess] Bar
# 132| getStmt: [CaseExpr] case ...
# 132| getValue: [MethodCall] call to expr
# 132| getReceiver: [Self, SelfVariableAccess] self
# 133| getBranch: [InClause] in ... then ...
# 133| getPattern: [HashPattern] { ..., ** }
# 134| getBranch: [InClause] in ... then ...
# 134| getPattern: [HashPattern] { ..., ** }
# 134| getKey: [SymbolLiteral] :x
# 127| getPrefixVariableAccess: [LocalVariableAccess] x
# 127| getElement: [IntegerLiteral] 1
# 127| getElement: [IntegerLiteral] 2
# 127| getSuffixVariableAccess: [LocalVariableAccess] y
# 128| getBranch: [InClause] in ... then ...
# 128| getPattern: [FindPattern] [ *,...,* ]
# 128| getClass: [ConstantReadAccess] Bar
# 128| getScopeExpr: [ConstantReadAccess] Foo
# 128| getElement: [IntegerLiteral] 1
# 129| getBranch: [InClause] in ... then ...
# 129| getPattern: [FindPattern] [ *,...,* ]
# 129| getClass: [ConstantReadAccess] Foo
# 129| getElement: [ConstantReadAccess] Bar
# 134| getStmt: [CaseExpr] case ...
# 134| getValue: [MethodCall] call to expr
# 134| getReceiver: [Self, SelfVariableAccess] self
# 135| getBranch: [InClause] in ... then ...
# 135| getPattern: [HashPattern] { ..., ** }
# 135| getClass: [ConstantReadAccess] Bar
# 135| getScopeExpr: [ConstantReadAccess] Foo
# 135| getKey: [SymbolLiteral] :x
# 135| getValue: [IntegerLiteral] 1
# 136| getBranch: [InClause] in ... then ...
# 136| getPattern: [HashPattern] { ..., ** }
# 136| getClass: [ConstantReadAccess] Bar
# 136| getScopeExpr: [ConstantReadAccess] Foo
# 136| getKey: [SymbolLiteral] :x
# 136| getValue: [IntegerLiteral] 1
# 136| getKey: [SymbolLiteral] :a
# 136| getRestVariableAccess: [LocalVariableAccess] rest
# 137| getBranch: [InClause] in ... then ...
# 137| getPattern: [HashPattern] { ..., ** }
# 137| getClass: [ConstantReadAccess] Foo
# 137| getKey: [SymbolLiteral] :y
# 137| getClass: [ConstantReadAccess] Bar
# 137| getScopeExpr: [ConstantReadAccess] Foo
# 137| getKey: [SymbolLiteral] :x
# 137| getValue: [IntegerLiteral] 1
# 138| getBranch: [InClause] in ... then ...
# 138| getPattern: [HashPattern] { ..., ** }
# 138| getClass: [ConstantReadAccess] Bar
# 138| getScopeExpr: [ConstantReadAccess] Foo
# 138| getKey: [SymbolLiteral] :x
# 138| getValue: [IntegerLiteral] 1
# 138| getKey: [SymbolLiteral] :a
# 138| getRestVariableAccess: [LocalVariableAccess] rest
# 139| getBranch: [InClause] in ... then ...
# 139| getPattern: [HashPattern] { ..., ** }
# 139| getClass: [ConstantReadAccess] Bar
# 139| getKey: [SymbolLiteral] :a
# 139| getValue: [IntegerLiteral] 1
# 139| getClass: [ConstantReadAccess] Foo
# 139| getKey: [SymbolLiteral] :y
# 140| getBranch: [InClause] in ... then ...
# 140| getPattern: [HashPattern] { ..., ** }
# 140| getClass: [ConstantReadAccess] Bar
# 141| getBranch: [InClause] in ... then ...
# 141| getPattern: [HashPattern] { ..., ** }
# 141| getClass: [ConstantReadAccess] Bar
# 141| getKey: [SymbolLiteral] :a
# 141| getValue: [IntegerLiteral] 1
modules/classes.rb:
# 2| [Toplevel] classes.rb
# 3| getStmt: [ClassDeclaration] Foo

View File

@@ -200,18 +200,21 @@
| control/cases.rb:105:6:105:15 | :"foo bar" | foo bar |
| control/cases.rb:106:7:106:7 | 5 | 5 |
| control/cases.rb:106:12:106:13 | 10 | 10 |
| control/cases.rb:125:11:125:11 | 1 | 1 |
| control/cases.rb:125:14:125:14 | 2 | 2 |
| control/cases.rb:126:18:126:18 | 1 | 1 |
| control/cases.rb:134:7:134:7 | :x | x |
| control/cases.rb:135:16:135:16 | :x | x |
| control/cases.rb:135:18:135:18 | 1 | 1 |
| control/cases.rb:136:16:136:16 | :x | x |
| control/cases.rb:136:18:136:18 | 1 | 1 |
| control/cases.rb:136:21:136:21 | :a | a |
| control/cases.rb:137:11:137:11 | :y | y |
| control/cases.rb:139:11:139:11 | :a | a |
| control/cases.rb:139:14:139:14 | 1 | 1 |
| control/cases.rb:107:7:107:7 | 1 | 1 |
| control/cases.rb:108:7:108:7 | 0 | 0 |
| control/cases.rb:108:11:108:12 | "" | |
| control/cases.rb:127:11:127:11 | 1 | 1 |
| control/cases.rb:127:14:127:14 | 2 | 2 |
| control/cases.rb:128:18:128:18 | 1 | 1 |
| control/cases.rb:136:7:136:7 | :x | x |
| control/cases.rb:137:16:137:16 | :x | x |
| control/cases.rb:137:18:137:18 | 1 | 1 |
| control/cases.rb:138:16:138:16 | :x | x |
| control/cases.rb:138:18:138:18 | 1 | 1 |
| control/cases.rb:138:21:138:21 | :a | a |
| control/cases.rb:139:11:139:11 | :y | y |
| control/cases.rb:141:11:141:11 | :a | a |
| control/cases.rb:141:14:141:14 | 1 | 1 |
| control/conditionals.rb:2:5:2:5 | 0 | 0 |
| control/conditionals.rb:3:5:3:5 | 0 | 0 |
| control/conditionals.rb:4:5:4:5 | 0 | 0 |

View File

@@ -3,10 +3,10 @@ caseValues
| cases.rb:26:1:29:3 | case ... | cases.rb:26:6:26:9 | call to expr |
| cases.rb:31:1:37:3 | case ... | cases.rb:31:6:31:9 | call to expr |
| cases.rb:39:1:80:3 | case ... | cases.rb:39:6:39:9 | call to expr |
| cases.rb:86:1:107:3 | case ... | cases.rb:86:6:86:9 | call to expr |
| cases.rb:111:1:119:3 | case ... | cases.rb:111:6:111:9 | call to expr |
| cases.rb:123:1:128:3 | case ... | cases.rb:123:6:123:9 | call to expr |
| cases.rb:132:1:140:3 | case ... | cases.rb:132:6:132:9 | call to expr |
| cases.rb:86:1:109:3 | case ... | cases.rb:86:6:86:9 | call to expr |
| cases.rb:113:1:121:3 | case ... | cases.rb:113:6:113:9 | call to expr |
| cases.rb:125:1:130:3 | case ... | cases.rb:125:6:125:9 | call to expr |
| cases.rb:134:1:142:3 | case ... | cases.rb:134:6:134:9 | call to expr |
caseNoValues
| cases.rb:18:1:22:3 | case ... |
caseElseBranches
@@ -16,10 +16,10 @@ caseElseBranches
caseNoElseBranches
| cases.rb:18:1:22:3 | case ... |
| cases.rb:39:1:80:3 | case ... |
| cases.rb:86:1:107:3 | case ... |
| cases.rb:111:1:119:3 | case ... |
| cases.rb:123:1:128:3 | case ... |
| cases.rb:132:1:140:3 | case ... |
| cases.rb:86:1:109:3 | case ... |
| cases.rb:113:1:121:3 | case ... |
| cases.rb:125:1:130:3 | case ... |
| cases.rb:134:1:142:3 | case ... |
caseWhenBranches
| cases.rb:8:1:15:3 | case ... | cases.rb:9:1:10:7 | when ... | 0 | cases.rb:9:6:9:6 | b | cases.rb:9:7:10:7 | then ... |
| cases.rb:8:1:15:3 | case ... | cases.rb:11:1:12:7 | when ... | 0 | cases.rb:11:6:11:6 | c | cases.rb:11:10:12:7 | then ... |
@@ -79,41 +79,43 @@ caseAllBranches
| cases.rb:39:1:80:3 | case ... | 37 | cases.rb:77:3:77:13 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 38 | cases.rb:78:3:78:8 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 39 | cases.rb:79:3:79:8 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 0 | cases.rb:87:3:87:6 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 1 | cases.rb:88:3:88:9 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 2 | cases.rb:89:3:89:8 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 3 | cases.rb:90:3:90:13 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 4 | cases.rb:91:3:91:16 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 5 | cases.rb:92:3:92:16 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 6 | cases.rb:93:3:93:17 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 7 | cases.rb:94:3:94:12 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 8 | cases.rb:95:3:95:10 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 9 | cases.rb:96:3:96:9 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 10 | cases.rb:97:3:97:11 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 11 | cases.rb:98:3:98:30 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 12 | cases.rb:99:3:99:8 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 13 | cases.rb:100:3:100:13 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 14 | cases.rb:101:3:101:15 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 15 | cases.rb:102:3:102:67 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 16 | cases.rb:103:3:103:21 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 17 | cases.rb:104:3:104:9 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 18 | cases.rb:105:3:105:15 | in ... then ... |
| cases.rb:86:1:107:3 | case ... | 19 | cases.rb:106:3:106:13 | in ... then ... |
| cases.rb:111:1:119:3 | case ... | 0 | cases.rb:112:3:112:8 | in ... then ... |
| cases.rb:111:1:119:3 | case ... | 1 | cases.rb:113:3:113:9 | in ... then ... |
| cases.rb:111:1:119:3 | case ... | 2 | cases.rb:114:3:114:11 | in ... then ... |
| cases.rb:111:1:119:3 | case ... | 3 | cases.rb:115:3:115:16 | in ... then ... |
| cases.rb:111:1:119:3 | case ... | 4 | cases.rb:116:3:116:11 | in ... then ... |
| cases.rb:111:1:119:3 | case ... | 5 | cases.rb:117:3:117:12 | in ... then ... |
| cases.rb:111:1:119:3 | case ... | 6 | cases.rb:118:3:118:25 | in ... then ... |
| cases.rb:123:1:128:3 | case ... | 0 | cases.rb:124:3:124:15 | in ... then ... |
| cases.rb:123:1:128:3 | case ... | 1 | cases.rb:125:3:125:20 | in ... then ... |
| cases.rb:123:1:128:3 | case ... | 2 | cases.rb:126:3:126:23 | in ... then ... |
| cases.rb:123:1:128:3 | case ... | 3 | cases.rb:127:3:127:20 | in ... then ... |
| cases.rb:132:1:140:3 | case ... | 0 | cases.rb:133:3:133:8 | in ... then ... |
| cases.rb:132:1:140:3 | case ... | 1 | cases.rb:134:3:134:10 | in ... then ... |
| cases.rb:132:1:140:3 | case ... | 2 | cases.rb:135:3:135:21 | in ... then ... |
| cases.rb:132:1:140:3 | case ... | 3 | cases.rb:136:3:136:33 | in ... then ... |
| cases.rb:132:1:140:3 | case ... | 4 | cases.rb:137:3:137:14 | in ... then ... |
| cases.rb:132:1:140:3 | case ... | 5 | cases.rb:138:3:138:15 | in ... then ... |
| cases.rb:132:1:140:3 | case ... | 6 | cases.rb:139:3:139:23 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 0 | cases.rb:87:3:87:6 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 1 | cases.rb:88:3:88:9 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 2 | cases.rb:89:3:89:8 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 3 | cases.rb:90:3:90:13 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 4 | cases.rb:91:3:91:16 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 5 | cases.rb:92:3:92:16 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 6 | cases.rb:93:3:93:17 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 7 | cases.rb:94:3:94:12 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 8 | cases.rb:95:3:95:10 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 9 | cases.rb:96:3:96:9 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 10 | cases.rb:97:3:97:11 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 11 | cases.rb:98:3:98:30 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 12 | cases.rb:99:3:99:8 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 13 | cases.rb:100:3:100:13 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 14 | cases.rb:101:3:101:15 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 15 | cases.rb:102:3:102:67 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 16 | cases.rb:103:3:103:21 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 17 | cases.rb:104:3:104:9 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 18 | cases.rb:105:3:105:15 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 19 | cases.rb:106:3:106:13 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 20 | cases.rb:107:3:107:11 | in ... then ... |
| cases.rb:86:1:109:3 | case ... | 21 | cases.rb:108:3:108:23 | in ... then ... |
| cases.rb:113:1:121:3 | case ... | 0 | cases.rb:114:3:114:8 | in ... then ... |
| cases.rb:113:1:121:3 | case ... | 1 | cases.rb:115:3:115:9 | in ... then ... |
| cases.rb:113:1:121:3 | case ... | 2 | cases.rb:116:3:116:11 | in ... then ... |
| cases.rb:113:1:121:3 | case ... | 3 | cases.rb:117:3:117:16 | in ... then ... |
| cases.rb:113:1:121:3 | case ... | 4 | cases.rb:118:3:118:11 | in ... then ... |
| cases.rb:113:1:121:3 | case ... | 5 | cases.rb:119:3:119:12 | in ... then ... |
| cases.rb:113:1:121:3 | case ... | 6 | cases.rb:120:3:120:25 | in ... then ... |
| cases.rb:125:1:130:3 | case ... | 0 | cases.rb:126:3:126:15 | in ... then ... |
| cases.rb:125:1:130:3 | case ... | 1 | cases.rb:127:3:127:20 | in ... then ... |
| cases.rb:125:1:130:3 | case ... | 2 | cases.rb:128:3:128:23 | in ... then ... |
| cases.rb:125:1:130:3 | case ... | 3 | cases.rb:129:3:129:20 | in ... then ... |
| cases.rb:134:1:142:3 | case ... | 0 | cases.rb:135:3:135:8 | in ... then ... |
| cases.rb:134:1:142:3 | case ... | 1 | cases.rb:136:3:136:10 | in ... then ... |
| cases.rb:134:1:142:3 | case ... | 2 | cases.rb:137:3:137:21 | in ... then ... |
| cases.rb:134:1:142:3 | case ... | 3 | cases.rb:138:3:138:33 | in ... then ... |
| cases.rb:134:1:142:3 | case ... | 4 | cases.rb:139:3:139:14 | in ... then ... |
| cases.rb:134:1:142:3 | case ... | 5 | cases.rb:140:3:140:15 | in ... then ... |
| cases.rb:134:1:142:3 | case ... | 6 | cases.rb:141:3:141:23 | in ... then ... |

View File

@@ -3,10 +3,10 @@
| cases.rb:26:1:29:3 | case ... | CaseExpr |
| cases.rb:31:1:37:3 | case ... | CaseExpr |
| cases.rb:39:1:80:3 | case ... | CaseExpr |
| cases.rb:86:1:107:3 | case ... | CaseExpr |
| cases.rb:111:1:119:3 | case ... | CaseExpr |
| cases.rb:123:1:128:3 | case ... | CaseExpr |
| cases.rb:132:1:140:3 | case ... | CaseExpr |
| cases.rb:86:1:109:3 | case ... | CaseExpr |
| cases.rb:113:1:121:3 | case ... | CaseExpr |
| cases.rb:125:1:130:3 | case ... | CaseExpr |
| cases.rb:134:1:142:3 | case ... | CaseExpr |
| conditionals.rb:10:1:12:3 | if ... | IfExpr |
| conditionals.rb:15:1:19:3 | if ... | IfExpr |
| conditionals.rb:22:1:30:3 | if ... | IfExpr |

View File

@@ -104,6 +104,8 @@ case expr
in :foo
in :"foo bar"
in -5 | +10
in (1 ..)
in (0 | "" | [] | {})
end
# array patterns