unifdef: KSH
no binary change
This commit is contained in:
18
syn.c
18
syn.c
@ -1,4 +1,4 @@
|
||||
/** $MirBSD: src/bin/ksh/syn.c,v 2.2 2004/12/13 19:09:06 tg Exp $ */
|
||||
/** $MirBSD: src/bin/ksh/syn.c,v 2.3 2004/12/18 18:58:30 tg Exp $ */
|
||||
/* $OpenBSD: syn.c,v 1.14 2003/10/22 07:40:38 jmc Exp $ */
|
||||
|
||||
/*
|
||||
@ -8,7 +8,7 @@
|
||||
#include "sh.h"
|
||||
#include "c_test.h"
|
||||
|
||||
__RCSID("$MirBSD: src/bin/ksh/syn.c,v 2.2 2004/12/13 19:09:06 tg Exp $");
|
||||
__RCSID("$MirBSD: src/bin/ksh/syn.c,v 2.3 2004/12/18 18:58:30 tg Exp $");
|
||||
|
||||
struct nesting_state {
|
||||
int start_token; /* token than began nesting (eg, FOR) */
|
||||
@ -39,14 +39,12 @@ static void nesting_push(struct nesting_state *save, int tok);
|
||||
static void nesting_pop(struct nesting_state *saved);
|
||||
static int assign_command(char *s);
|
||||
static int inalias(struct source *s);
|
||||
#ifdef KSH
|
||||
static int dbtestp_isa(Test_env *te, Test_meta meta);
|
||||
static const char *dbtestp_getopnd(Test_env *te, Test_op op,
|
||||
int do_eval);
|
||||
static int dbtestp_eval(Test_env *te, Test_op op, const char *opnd1,
|
||||
const char *opnd2, int do_eval);
|
||||
static void dbtestp_error(Test_env *te, int offset, const char *msg);
|
||||
#endif /* KSH */
|
||||
|
||||
static struct op *outtree; /* yyparse output */
|
||||
|
||||
@ -286,7 +284,6 @@ get_command(int cf)
|
||||
t = nested(TBRACE, '{', '}');
|
||||
break;
|
||||
|
||||
#ifdef KSH
|
||||
case MDPAREN:
|
||||
{
|
||||
static const char let_cmd[] = { CHAR, 'l', CHAR, 'e',
|
||||
@ -300,9 +297,7 @@ get_command(int cf)
|
||||
XPput(args, yylval.cp);
|
||||
break;
|
||||
}
|
||||
#endif /* KSH */
|
||||
|
||||
#ifdef KSH
|
||||
case DBRACKET: /* [[ .. ]] */
|
||||
/* Leave KEYWORD in syniocf (allow if [[ -n 1 ]] then ...) */
|
||||
t = newtp(TDBRACKET);
|
||||
@ -320,7 +315,6 @@ get_command(int cf)
|
||||
test_parse(&te);
|
||||
}
|
||||
break;
|
||||
#endif /* KSH */
|
||||
|
||||
case FOR:
|
||||
case SELECT:
|
||||
@ -643,9 +637,7 @@ const struct tokeninfo {
|
||||
{ "case", CASE, TRUE },
|
||||
{ "esac", ESAC, TRUE },
|
||||
{ "for", FOR, TRUE },
|
||||
#ifdef KSH
|
||||
{ "select", SELECT, TRUE },
|
||||
#endif /* KSH */
|
||||
{ "while", WHILE, TRUE },
|
||||
{ "until", UNTIL, TRUE },
|
||||
{ "do", DO, TRUE },
|
||||
@ -656,17 +648,13 @@ const struct tokeninfo {
|
||||
{ "{", '{', TRUE },
|
||||
{ "}", '}', TRUE },
|
||||
{ "!", BANG, TRUE },
|
||||
#ifdef KSH
|
||||
{ "[[", DBRACKET, TRUE },
|
||||
#endif /* KSH */
|
||||
/* Lexical tokens (0[EOF], LWORD and REDIR handled specially) */
|
||||
{ "&&", LOGAND, FALSE },
|
||||
{ "||", LOGOR, FALSE },
|
||||
{ ";;", BREAK, FALSE },
|
||||
#ifdef KSH
|
||||
{ "((", MDPAREN, FALSE },
|
||||
{ "|&", COPROC, FALSE },
|
||||
#endif /* KSH */
|
||||
/* and some special cases... */
|
||||
{ "newline", '\n', FALSE },
|
||||
{ NULL, 0, FALSE }
|
||||
@ -815,7 +803,6 @@ inalias(struct source *s)
|
||||
}
|
||||
|
||||
|
||||
#ifdef KSH
|
||||
/* Order important - indexed by Test_meta values
|
||||
* Note that ||, &&, ( and ) can't appear in as unquoted strings
|
||||
* in normal shell input, so these can be interpreted unambiguously
|
||||
@ -921,4 +908,3 @@ dbtestp_error(Test_env *te, int offset, const char *msg)
|
||||
}
|
||||
syntaxerr(msg);
|
||||
}
|
||||
#endif /* KSH */
|
||||
|
Reference in New Issue
Block a user