Skip to content

Commit 5194e86

Browse files
committed
Add InfixOperatorExpr.
1 parent 0b32290 commit 5194e86

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

utils/gyb_syntax_support/ExprNodes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,17 @@
199199
Child('ArrowToken', kind='ArrowToken'),
200200
]),
201201

202+
# An infix binary expression like x + y.
203+
# NOTE: This won't come directly out of the parser. Rather, it is the
204+
# result of "folding" a SequenceExpr based on knowing the precedence
205+
# relationships amongst the different infix operators.
206+
Node('InfixOperatorExpr', kind='Expr',
207+
children=[
208+
Child('FirstOperand', kind='Expr'),
209+
Child('Operator', kind='BinaryOperatorExpr'),
210+
Child('SecondOperand', kind='Expr'),
211+
]),
212+
202213
# A floating-point literal
203214
# 4.0
204215
# -3.9

utils/gyb_syntax_support/NodeSerializationCodes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
'MissingType': 264,
269269
'MissingPattern': 265,
270270
'GarbageNodes' : 266,
271+
'InfixOperatorExpr': 267,
271272
}
272273

273274

0 commit comments

Comments
 (0)