From 69487ed29aed49ca0e3481e9783e02e9156258b2 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Fri, 22 May 2020 17:14:48 -0700 Subject: fix: encapsulated the IO stack into the lexer --- sys/cmd/cc/ast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/cmd/cc/ast.c') diff --git a/sys/cmd/cc/ast.c b/sys/cmd/cc/ast.c index 4553b96..184ddaf 100644 --- a/sys/cmd/cc/ast.c +++ b/sys/cmd/cc/ast.c @@ -1275,12 +1275,10 @@ Bad: // ----------------------------------------------------------------------- // top level api -void +error parse(Parser *p, Lexer *lx) { Token tok; - p->sp = p->spstk; - while ((tok = peek(p, 0)), tok.kind > Aeof) { if (p->ast.len >= p->ast.cap) { p->ast.cap += 20; @@ -1288,4 +1286,6 @@ parse(Parser *p, Lexer *lx) } p->ast.decls[p->ast.len++] = decl(p, lx); } + + return 0; } -- cgit v1.2.1