aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-05-20 18:28:31 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-05-20 18:28:31 -0700
commita9e3c42ac5696c56adaffbb4007e9d969563337b (patch)
treec061b3ac4e0469ef46d4b7a4dd7c66a2dd59330b /sys/cmd/cc/cc.c
parent25f01e69f946c37a74de8646a3cd047f849885bc (diff)
feat: prototype of AST
Diffstat (limited to 'sys/cmd/cc/cc.c')
-rw-r--r--sys/cmd/cc/cc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/cmd/cc/cc.c b/sys/cmd/cc/cc.c
index cb37af4..fcb9217 100644
--- a/sys/cmd/cc/cc.c
+++ b/sys/cmd/cc/cc.c
@@ -253,6 +253,12 @@ init(void)
C.lxr = (Lexer){ 0 };
C.lxr.b = C.lxr.buf;
+
+ /* predefine macros */
+ dodefine(&C.lxr, "__LINE__");
+ dodefine(&C.lxr, "__FILE__");
+ C.lxr.macline = (uintptr)lookup(&C.lxr.sym, "__LINE__");
+ C.lxr.macfile = (uintptr)lookup(&C.lxr.sym, "__FILE__");
}
error