We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a27bc28 commit 79b119dCopy full SHA for 79b119d
parser/grammar.y
@@ -915,17 +915,13 @@ tests:
915
}
916
917
assert_stmt:
918
- ASSERT tests
919
- {
920
- tests := $2
921
- switch len(tests) {
922
- case 1:
923
- $$ = &ast.Assert{StmtBase: ast.StmtBase{$<pos>$}, Test: tests[0]}
924
- case 2:
925
- $$ = &ast.Assert{StmtBase: ast.StmtBase{$<pos>$}, Test: tests[0], Msg: tests[1]}
926
- default:
927
- yylex.Error("Invalid syntax")
928
- }
+ ASSERT test
+ {
+ $$ = &ast.Assert{StmtBase: ast.StmtBase{$<pos>$}, Test: $2}
+ }
+| ASSERT test ',' test
+ $$ = &ast.Assert{StmtBase: ast.StmtBase{$<pos>$}, Test: $2, Msg: $4}
929
930
931
compound_stmt:
0 commit comments