aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/cc/lex.c')
-rw-r--r--sys/cmd/cc/lex.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/cmd/cc/lex.c b/sys/cmd/cc/lex.c
index 7a08373..e35ea7e 100644
--- a/sys/cmd/cc/lex.c
+++ b/sys/cmd/cc/lex.c
@@ -636,6 +636,16 @@ Dispatch:
sym = lookup(&lx->sym, tok.val.s);
if (sym && ((uintptr)sym->name != (uintptr)lx->io->path)) {
+ if ((uintptr)sym == lx->macline) {
+ tok.kind = Alit | Vint;
+ tok.val.i = lx->pos.line;
+ goto Return;
+ }
+ if ((uintptr)sym == lx->macfile) {
+ tok.kind = Alit | Vstr;
+ tok.val.s = lx->pos.path;
+ goto Return;
+ }
io = makeio(sym->name);
io->rdr.end += expandmacro(lx, sym, io->b);
*io->rdr.end++ = EOF;