From 91c673b37782d4cd90e5cf9a8e4491723e6c04bf Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Fri, 19 Jun 2020 14:44:54 -0700 Subject: fix: many small bug fixes with parser and lexer --- sys/cmd/rc/rc.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'sys/cmd/rc/rc.h') diff --git a/sys/cmd/rc/rc.h b/sys/cmd/rc/rc.h index ad46a77..7146aa0 100644 --- a/sys/cmd/rc/rc.h +++ b/sys/cmd/rc/rc.h @@ -13,22 +13,23 @@ #define GLOB 0x01 -/* TODO: make sure there are no collisions */ enum { /* keywords */ - Kstart=11, Kfor, Kin, Kwhile, Kif, Kelse, - Kswitch, Kcase, Kfunc, Ktwiddle, - Kbang, Ksubsh, Kend, + Kstart = 11, + Tfor, Tin, Twhile, Tif, Telse, + Tswitch, Tcase, Tfunc, Ttwiddle, + Tbang, Tsubshell, + Kend, /* tokens */ - Aword='w', Aredir='r', Adup='d', Asimple='s', - Aargs='A', Awords='W', Abrace='b', Aparen='p', Asub='S', - Apcmd='c', Apipefd='-', Aandand='%', Aoror='@', Acount='#', + Tword='w', Tredir='r', Tdup='d', Tsimple='s', + Targs='A', Twords='W', Tbrace='b', Tparen='p', Tsub='S', + Tpcmd='c', Tpipefd='-', Tandand='%', Toror='@', Tcount='#', - Atick='`', Apipe = '|', Adol='$', Aquote='"', Aand='&', - Alparen = '(', Arparen = ')', Albrace='{', Arbrace='}', - Asemi=';', Acarot='^', Aeq='=', + Ttick='`', Tpipe = '|', Tdol='$', Tquote='"', Tand='&', + Tlparen = '(', Trparen = ')', Tlbrace='{', Trbrace='}', + Tsemi=';', Tcarot='^', Teq='=', }; enum @@ -236,7 +237,7 @@ void initkw(void); */ void skipnl(void); -int wordchr(char c); +int wordchr(int c); void rcerror(char *msg, ...); int lex(Tree **node); -- cgit v1.2.1