aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/rc.h
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-06-19 14:44:54 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-06-19 14:44:54 -0700
commit91c673b37782d4cd90e5cf9a8e4491723e6c04bf (patch)
tree0c334edf4729283b08cd95ae577f890b089f26fc /sys/cmd/rc/rc.h
parent765ff8b3423599396d0aa33885e2495ad86dbb19 (diff)
fix: many small bug fixes with parser and lexer
Diffstat (limited to 'sys/cmd/rc/rc.h')
-rw-r--r--sys/cmd/rc/rc.h23
1 files changed, 12 insertions, 11 deletions
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);