aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2012-03-01 15:51:58 +0800
committerMu Qiao <qiaomuf@gentoo.org>2012-03-01 15:51:58 +0800
commit62f2e7c112601d5bc7e7f5d042d4fce1e354865e (patch)
tree56a71efbe59dd1f2ab1e1e5348880f5f842cfc59 /bashast/gunit
parentParser: allow multiple operands in test expression (diff)
downloadlibbash-62f2e7c112601d5bc7e7f5d042d4fce1e354865e.tar.gz
libbash-62f2e7c112601d5bc7e7f5d042d4fce1e354865e.tar.bz2
libbash-62f2e7c112601d5bc7e7f5d042d4fce1e354865e.zip
Parser: allow empty replacement pattern
Diffstat (limited to 'bashast/gunit')
-rw-r--r--bashast/gunit/param_main.gunit3
1 files changed, 3 insertions, 0 deletions
diff --git a/bashast/gunit/param_main.gunit b/bashast/gunit/param_main.gunit
index 01ec853..2168d54 100644
--- a/bashast/gunit/param_main.gunit
+++ b/bashast/gunit/param_main.gunit
@@ -90,6 +90,9 @@ variable_reference:
"${!#/a/bc}" -> (VAR_REF (REPLACE_FIRST (VAR_REF #) (STRING a) (STRING bc)))
"${!abc/a/bc}" -> (VAR_REF (REPLACE_FIRST (VAR_REF abc) (STRING a) (STRING bc)))
"${!123/a/bc}" -> (VAR_REF (REPLACE_FIRST (VAR_REF 123) (STRING a) (STRING bc)))
+"${search_paths/%/${root}}" -> (VAR_REF (REPLACE_AT_END search_paths (STRING NAME) (STRING $ { root })))
+"${search_paths/#/${root}}" -> (VAR_REF (REPLACE_AT_START search_paths (STRING NAME) (STRING $ { root })))
+"${search_paths//${root}}" -> (VAR_REF (REPLACE_ALL search_paths (STRING (VAR_REF root))))
variable_definition_atom:
"MY_PN=${PN/asterisk-}" -> (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -)))))