aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-05-24 08:06:34 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-05-24 08:06:34 -0700
commitaf0c1d5ac3960776a4a485ca587744464630e634 (patch)
tree11d53c335586cea8822af9f2fb2ff57027c9b095 /sys/cmd/cc/cc.c
parent39e4332d45e770dfe684071db4d3427fa2ca6b0c (diff)
contin: in the middle of reorganizing the declaration parsing. check-in before reorganizing keywords
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;
}