@@ -2,6 +2,10 @@ if case let x = x + 10 {
22 print(x)
33}
44
5+ if case var y = y + 10 {
6+ y += 1
7+ }
8+
59---
610
711sourceFile
@@ -57,6 +61,54 @@ sourceFile
5761 bindingSpecifier: let
5862 caseKeyword: case
5963 ifKeyword: if
64+ codeBlockItem
65+ item:
66+ expressionStmt
67+ expression:
68+ ifExpr
69+ body:
70+ codeBlock
71+ leftBrace: {
72+ rightBrace: }
73+ statements:
74+ codeBlockItem
75+ item:
76+ infixOperatorExpr
77+ operator:
78+ binaryOperatorExpr
79+ operator: binaryOperator "+="
80+ leftOperand:
81+ declReferenceExpr
82+ baseName: identifier "y"
83+ rightOperand:
84+ integerLiteralExpr
85+ literal: integerLiteral "1"
86+ conditions:
87+ conditionElement
88+ condition:
89+ matchingPatternCondition
90+ initializer:
91+ initializerClause
92+ equal: =
93+ value:
94+ infixOperatorExpr
95+ operator:
96+ binaryOperatorExpr
97+ operator: binaryOperator "+"
98+ leftOperand:
99+ declReferenceExpr
100+ baseName: identifier "y"
101+ rightOperand:
102+ integerLiteralExpr
103+ literal: integerLiteral "10"
104+ pattern:
105+ valueBindingPattern
106+ pattern:
107+ identifierPattern
108+ identifier: identifier "y"
109+ bindingSpecifier: var
110+ caseKeyword: case
111+ ifKeyword: if
60112
61113---
62114
@@ -68,8 +120,11 @@ top_level
68120 condition:
69121 pattern_guard_expr
70122 pattern:
71- named_pattern
72- identifier: identifier "x"
123+ expr_pattern
124+ modifier: modifier "let"
125+ expr:
126+ named_pattern
127+ identifier: identifier "x"
73128 value:
74129 binary_expr
75130 left:
@@ -89,3 +144,28 @@ top_level
89144 value:
90145 name_expr
91146 identifier: identifier "x"
147+ if_expr
148+ condition:
149+ pattern_guard_expr
150+ pattern:
151+ expr_pattern
152+ modifier: modifier "var"
153+ expr:
154+ named_pattern
155+ identifier: identifier "y"
156+ value:
157+ binary_expr
158+ left:
159+ name_expr
160+ identifier: identifier "y"
161+ operator: infix_operator "+"
162+ right: int_literal "10"
163+ then:
164+ block
165+ stmt:
166+ compound_assign_expr
167+ target:
168+ name_expr
169+ identifier: identifier "y"
170+ operator: infix_operator "+="
171+ value: int_literal "1"
0 commit comments