diff options
author | Carlos Maniero <carlos@maniero.me> | 2023-05-02 23:45:55 -0300 |
---|---|---|
committer | Johnny Richard <johnny@johnnyrichard.com> | 2023-05-03 22:59:03 +0200 |
commit | d97cdd9e84879d8fc3adf4bcf5c130f498e95b79 (patch) | |
tree | 26b71c45f9ecb40be1cab4b855c155320e1538b0 /test | |
parent | e255b793d66441097955163e3abb8f5d68ed54ba (diff) |
parser: Parser allocate memory for expressions
Signed-off-by: Carlos Maniero <carlos@maniero.me>
Diffstat (limited to 'test')
-rw-r--r-- | test/parser_test.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/parser_test.c b/test/parser_test.c index ce77828..2d749da 100644 --- a/test/parser_test.c +++ b/test/parser_test.c @@ -140,9 +140,8 @@ test_parse_arithmetic_expression(const MunitParameter params[], void *user_data_ make_lexer_from_static_src(&lexer, "1 + 3 * 3 / 2 - 1"); parser_init(&parser, &lexer, scope); - ast_node_t *ast_expression = ast_node_new(); - bool parsed = parser_parse_expression(&parser, ast_expression); - assert_true(parsed); + ast_node_t *ast_expression = parser_parse_expression(&parser); + assert_not_null(ast_expression); ast_node_t *exp1 = ast_expression; { |