summaryrefslogtreecommitdiffstats
path: root/bin/sh/nodetypes
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-06-17 13:03:49 +0000
committerjilles <jilles@FreeBSD.org>2011-06-17 13:03:49 +0000
commitc7a72567a8474dcecd93215073976b04171d1144 (patch)
treed74a77976194c0d5d68bbf18c002a166b97300a5 /bin/sh/nodetypes
parentf405f6d6f8e62f9714eb668d35001c794646022b (diff)
downloadFreeBSD-src-c7a72567a8474dcecd93215073976b04171d1144.zip
FreeBSD-src-c7a72567a8474dcecd93215073976b04171d1144.tar.gz
sh: Add case statement fallthrough (with ';&' instead of ';;').
Replacing ;; with the new control operator ;& will cause the next list to be executed as well without checking its pattern, continuing until a list ends with ;; or until the end of the case statement. This is like omitting "break" in a C "switch" statement. The sequence ;& was formerly invalid. This feature is proposed for the next POSIX issue in Austin Group issue #449.
Diffstat (limited to 'bin/sh/nodetypes')
-rw-r--r--bin/sh/nodetypes3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes
index e1e1b04..f705827 100644
--- a/bin/sh/nodetypes
+++ b/bin/sh/nodetypes
@@ -96,12 +96,13 @@ NCASE ncase # a case statement
expr nodeptr # the word to switch on
cases nodeptr # the list of cases (NCLIST nodes)
-NCLIST nclist # a case
+NCLIST nclist # a case ending with ;;
type int
next nodeptr # the next case in list
pattern nodeptr # list of patterns for this case
body nodeptr # code to execute for this case
+NCLISTFALLTHRU nclist # a case ending with ;&
NDEFUN narg # define a function. The "next" field contains
# the body of the function.
OpenPOWER on IntegriCloud