diff options
author | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-03-15 13:08:45 -0500 |
---|---|---|
committer | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-03-15 13:08:45 -0500 |
commit | 09cff699a514e452eccc6420f1213967b767cb3e (patch) | |
tree | e9888cd55d03c840b20d080af4e472453c910835 /bin/sh/syntax.c | |
parent | ffeabdfb18fd21102159641f5258e8b1c473dec2 (diff) | |
download | userland-09cff699a514e452eccc6420f1213967b767cb3e.tar.gz userland-09cff699a514e452eccc6420f1213967b767cb3e.tar.bz2 userland-09cff699a514e452eccc6420f1213967b767cb3e.tar.xz userland-09cff699a514e452eccc6420f1213967b767cb3e.zip |
rm bin/sh usr.bin/make: utilities provided by other packages
Diffstat (limited to 'bin/sh/syntax.c')
-rw-r--r-- | bin/sh/syntax.c | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/bin/sh/syntax.c b/bin/sh/syntax.c deleted file mode 100644 index 7b460d4..0000000 --- a/bin/sh/syntax.c +++ /dev/null @@ -1,111 +0,0 @@ -/* $NetBSD: syntax.c,v 1.7 2018/12/03 06:40:26 kre Exp $ */ - -#include <sys/cdefs.h> -__RCSID("$NetBSD: syntax.c,v 1.7 2018/12/03 06:40:26 kre Exp $"); - -#include <limits.h> -#include "shell.h" -#include "syntax.h" -#include "parser.h" - -#if CWORD != 0 -#error initialisation assumes 'CWORD' is zero -#endif - -#define ndx(ch) (ch + 2 - CHAR_MIN) -#define set(ch, val) [ndx(ch)] = val, -#define set_range(s, e, val) [ndx(s) ... ndx(e)] = val, - -/* syntax table used when not in quotes */ -const char basesyntax[258] = { CFAKE, CEOF, - set_range(CTL_FIRST, CTL_LAST, CCTL) - set('\n', CNL) - set('\\', CBACK) - set('\'', CSQUOTE) - set('"', CDQUOTE) - set('`', CBQUOTE) - set('$', CVAR) - set('}', CENDVAR) - set('<', CSPCL) - set('>', CSPCL) - set('(', CSPCL) - set(')', CSPCL) - set(';', CSPCL) - set('&', CSPCL) - set('|', CSPCL) - set(' ', CSPCL) - set('\t', CSPCL) -}; - -/* syntax table used when in double quotes */ -const char dqsyntax[258] = { CFAKE, CEOF, - set_range(CTL_FIRST, CTL_LAST, CCTL) - set('\n', CNL) - set('\\', CBACK) - set('"', CDQUOTE) - set('`', CBQUOTE) - set('$', CVAR) - set('}', CENDVAR) - /* ':/' for tilde expansion, '-]' for [a\-x] pattern ranges */ - set('!', CCTL) - set('*', CCTL) - set('?', CCTL) - set('[', CCTL) - set('=', CCTL) - set('~', CCTL) - set(':', CCTL) - set('/', CCTL) - set('-', CCTL) - set(']', CCTL) -}; - -/* syntax table used when in single quotes */ -const char sqsyntax[258] = { CFAKE, CEOF, - set_range(CTL_FIRST, CTL_LAST, CCTL) - set('\n', CNL) - set('\'', CSQUOTE) - set('\\', CSBACK) - /* ':/' for tilde expansion, '-]' for [a\-x] pattern ranges */ - set('!', CCTL) - set('*', CCTL) - set('?', CCTL) - set('[', CCTL) - set('=', CCTL) - set('~', CCTL) - set(':', CCTL) - set('/', CCTL) - set('-', CCTL) - set(']', CCTL) -}; - -/* syntax table used when in arithmetic */ -const char arisyntax[258] = { CFAKE, CEOF, - set_range(CTL_FIRST, CTL_LAST, CCTL) - set('\n', CNL) - set('\\', CBACK) - set('`', CBQUOTE) - set('\'', CSQUOTE) - set('"', CDQUOTE) - set('$', CVAR) - set('}', CENDVAR) - set('(', CLP) - set(')', CRP) -}; - -/* character classification table */ -const char is_type[258] = { 0, 0, - set_range('0', '9', ISDIGIT) - set_range('a', 'z', ISLOWER) - set_range('A', 'Z', ISUPPER) - set('_', ISUNDER) - set('#', ISSPECL) - set('?', ISSPECL) - set('$', ISSPECL) - set('!', ISSPECL) - set('-', ISSPECL) - set('*', ISSPECL) - set('@', ISSPECL) - set(' ', ISSPACE) - set('\t', ISSPACE) - set('\n', ISSPACE) -}; |