diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2020-05-22 17:14:48 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2020-05-22 17:14:48 -0700 |
commit | 69487ed29aed49ca0e3481e9783e02e9156258b2 (patch) | |
tree | 2d66daf2f8798b0ae8595f8cea593e076dbe971c /sys/cmd/cc/ast.c | |
parent | 0d5942d8deaa70427df6df016b3ed9dedfb65b0d (diff) |
fix: encapsulated the IO stack into the lexer
Diffstat (limited to 'sys/cmd/cc/ast.c')
-rw-r--r-- | sys/cmd/cc/ast.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |