diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ast.c | 15 | ||||
| -rw-r--r-- | src/parser_helper.c | 1 |
2 files changed, 7 insertions, 9 deletions
@@ -3027,23 +3027,22 @@ size_t ast_list_len(struct ast_node *node) return count; } -struct ast_node *ast_last_node(struct ast_node *n) +struct ast_node *ast_last_node(struct ast_node *list) { - if (!n) + if (!list) return NULL; - while (n->next) - n = n->next; + while (list->next) + list = list->next; - return n; + return list; } -struct ast_node *ast_block_last(struct ast_node *n) +struct ast_node *ast_block_last(struct ast_node *block) { - struct ast_node *b = ast_last_node(n); + struct ast_node *b = ast_last_node(block); if (b && b->node_type == AST_BLOCK) return ast_block_last(b->_block.body); return b; } - diff --git a/src/parser_helper.c b/src/parser_helper.c index 5a90df8..2ac3f0d 100644 --- a/src/parser_helper.c +++ b/src/parser_helper.c @@ -28,7 +28,6 @@ void parse(struct parser *p, const char *fname, const char *buf) p->fname = fname; p->buf = buf; - p->buf_offset = 0; p->comment_nesting = 0; p->failed = false; |
