aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/cc/cc.c')
-rw-r--r--sys/cmd/cc/cc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/cmd/cc/cc.c b/sys/cmd/cc/cc.c
index 16cc6e2..02ff773 100644
--- a/sys/cmd/cc/cc.c
+++ b/sys/cmd/cc/cc.c
@@ -201,7 +201,7 @@ initlx(Lexer *lx)
{
int i;
- *lx = (Lexer){ 0 };
+ memset(lx, 0, sizeof(*lx));
lx->b = lx->buf;
/* predefine macros */
@@ -266,8 +266,8 @@ compile(byte *path)
}
}
- initlx(&lx);
initp(&p);
+ initlx(&lx);
lx.io = openio(&lx, path);
lx.pos = (Pos){
@@ -276,10 +276,7 @@ compile(byte *path)
.col = 1,
};
- Token t;
- while (t = lex(&lx), t.kind != Aeof)
- ;
- // err = parse(&p, &lx);
+ err = parse(&p, &lx);
freelx(&lx);
return err;
}