File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
main/java/com/google/api/generator/engine/ast
test/java/com/google/api/generator/engine/ast Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public ExprStatement build() {
52
52
(expr instanceof MethodInvocationExpr )
53
53
|| (expr instanceof ReferenceConstructorExpr )
54
54
|| (expr instanceof AssignmentExpr )
55
+ || (expr instanceof AssignmentOperationExpr )
55
56
|| (expr instanceof ThrowExpr )
56
57
|| (expr instanceof ReturnExpr )
57
58
|| (expr instanceof UnaryOperationExpr
Original file line number Diff line number Diff line change @@ -79,6 +79,15 @@ public void validExprStatement_unaryOperation() {
79
79
Variable .builder ().setType (TypeNode .INT ).setName ("i" ).build ())));
80
80
}
81
81
82
+ @ Test
83
+ public void validExprStatement_assignmentOperationExpr () {
84
+ VariableExpr lhsExpr =
85
+ VariableExpr .withVariable (Variable .builder ().setName ("i" ).setType (TypeNode .INT ).build ());
86
+ ValueExpr rhsExpr =
87
+ ValueExpr .withValue (PrimitiveValue .builder ().setValue ("5" ).setType (TypeNode .INT ).build ());
88
+ assertValidExprStatement (AssignmentOperationExpr .multiplyAssignmentWithExprs (lhsExpr , rhsExpr ));
89
+ }
90
+
82
91
@ Test
83
92
public void invalidExprStatement_variable () {
84
93
Variable variable = Variable .builder ().setType (TypeNode .INT ).setName ("libraryClient" ).build ();
You can’t perform that action at this time.
0 commit comments