aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/test.rc
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-05-04 23:20:08 -0400
committerRuss Cox <rsc@swtch.com>2020-05-04 23:41:15 -0400
commit7d6a248f2c68d70f58387afc69e73e695c3d940c (patch)
tree90dfff6deaf86185368433656b62dcc131bd07ef /src/cmd/rc/test.rc
parent3caf5c238a886d06b438ec6d42f2609b8625463f (diff)
downloadplan9port-7d6a248f2c68d70f58387afc69e73e695c3d940c.tar.gz
plan9port-7d6a248f2c68d70f58387afc69e73e695c3d940c.tar.bz2
plan9port-7d6a248f2c68d70f58387afc69e73e695c3d940c.zip
rc: move free carat handling into parser
This fixes at least one shell script (printfont) that expected 'x'`{y}'z' to mean 'x'^`{y}^'z' as it now does. Before it meant: 'x'^`{y} 'z' One surprise is that adjacent lists get a free carat: (x y z)(1 2 3) is (x1 y2 z3) This doesn't affect any rc script in Plan 9 or plan9port.
Diffstat (limited to 'src/cmd/rc/test.rc')
-rw-r--r--src/cmd/rc/test.rc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/rc/test.rc b/src/cmd/rc/test.rc
index 5c658132..7a83ad17 100644
--- a/src/cmd/rc/test.rc
+++ b/src/cmd/rc/test.rc
@@ -1,5 +1,9 @@
# test for parser
+a
+a b
+a|b
+a | b
{a; b; c}
x=y a && b || c
x=y a | b | c
@@ -63,3 +67,10 @@ x ||
y
x |
y
+switch x {y} && z
+switch x {} | y
+
+OPTIONS=$OPTIONS' /axescount '^`{echo $1 | sed s/-a//}^' def'
+
+# bug in old printfont script - expected more free carats
+# OPTIONS=$OPTIONS' /axescount '`{echo $1 | sed s/-a//}' def'