From 7ea7654db6e827038e38c3589c8d5b314db3fcb2 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Mon, 18 May 2020 20:28:51 -0700 Subject: fix: line accounting is less buggy --- sys/cmd/cc/cc.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'sys/cmd/cc/cc.h') diff --git a/sys/cmd/cc/cc.h b/sys/cmd/cc/cc.h index 84f173f..0e525be 100644 --- a/sys/cmd/cc/cc.h +++ b/sys/cmd/cc/cc.h @@ -235,8 +235,9 @@ struct SymTab Sym **vals; }; -Sym *lookup(SymTab *tab, string ident); Sym *define(SymTab *tab, string ident, int kind); +Sym *lookup(SymTab *tab, string ident); +error forget(SymTab *tab, string ident); struct Lexer { @@ -363,8 +364,8 @@ struct Decl enum { IOnil = iota(0), - IOonce = iota(1), - IOmac = iota(2), + IOfile = iota(1), + IObuff = iota(2), }; struct Io @@ -381,6 +382,7 @@ struct Io struct Io *link; }; +/* cc.c io functions */ Io* openio(byte *path); Io* makeio(); void freeio(Io *io); @@ -396,6 +398,7 @@ struct StrTab int32 *vals; }; +/* cc.c string functions */ int32 intern(byte **str); string internview(byte* beg, byte *end); @@ -413,6 +416,11 @@ struct Compiler Io *io; Io iostk[100]; + struct { + int cap; + int len; + string *path; + } omit; string outfile; @@ -420,6 +428,8 @@ struct Compiler }; extern Compiler C; -void init(); +/* cc.c compiler functions */ +void pushomit(string omit); +void init(); #undef iota -- cgit v1.2.1