add pointers, variable arguments and void functions

This commit is contained in:
r4
2021-12-28 13:39:12 +01:00
parent a706ea6a3f
commit 22f71d7e56
9 changed files with 140 additions and 40 deletions

16
lex.c
View File

@@ -222,6 +222,15 @@ TokList lex(const char *s, Pool *static_vars) {
continue;
}
break;
case '&':
consume(&pos, *(s++));
if (s[0] == '&')
emit(&toks, &pos, (Tok){ .kind = TokOp, .Op = OpAnd });
else {
emit(&toks, &pos, (Tok){ .kind = TokOp, .Op = OpAddrOf });
continue;
}
break;
case '!':
consume(&pos, *(s++));
if (s[0] == '=')
@@ -231,13 +240,6 @@ TokList lex(const char *s, Pool *static_vars) {
continue;
}
break;
case '&':
consume(&pos, *(s++));
if (s[0] == '&')
emit(&toks, &pos, (Tok){ .kind = TokOp, .Op = OpAnd });
else
continue;
break;
case '|':
consume(&pos, *(s++));
if (s[0] == '|')