summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.h
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2006-11-05 18:36:05 +0000
committerstefanf <stefanf@FreeBSD.org>2006-11-05 18:36:05 +0000
commitd02f26394e8614923870babd1d3518dde707c61a (patch)
tree03b401ffcd1d70294e77fc5bb3a1d899575f0939 /bin/sh/parser.h
parentdb8b5b89e2af712352769edf1c4350214fe10657 (diff)
downloadFreeBSD-src-d02f26394e8614923870babd1d3518dde707c61a.zip
FreeBSD-src-d02f26394e8614923870babd1d3518dde707c61a.tar.gz
When parsing an invalid parameter expansion (eg. ${} or ${foo@bar}) do not
issue a syntax error immediately but save the information that it is erroneous for later when the parameter expansion is actually done. This means eg. "false && ${}" will not generate an error which seems to be required by POSIX. Include the invalid parameter expansion in the error message (sometimes abbreviated with ... because recovering it would require a lot of code). PR: 105078 Submitted by: emaste
Diffstat (limited to 'bin/sh/parser.h')
-rw-r--r--bin/sh/parser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/sh/parser.h b/bin/sh/parser.h
index b0bd99e..6b5687d 100644
--- a/bin/sh/parser.h
+++ b/bin/sh/parser.h
@@ -60,6 +60,7 @@
#define VSTRIMRIGHT 0x8 /* ${var%pattern} */
#define VSTRIMRIGHTMAX 0x9 /* ${var%%pattern} */
#define VSLENGTH 0xa /* ${#var} */
+#define VSERROR 0xb /* Syntax error, issue when expanded */
/*
OpenPOWER on IntegriCloud