diff options
Diffstat (limited to 'bashast/gunit/param_main.gunit')
-rw-r--r-- | bashast/gunit/param_main.gunit | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bashast/gunit/param_main.gunit b/bashast/gunit/param_main.gunit index 9dfcd9e..0744004 100644 --- a/bashast/gunit/param_main.gunit +++ b/bashast/gunit/param_main.gunit @@ -18,13 +18,13 @@ */ gunit java_libbash; -var_ref: +variable_reference: "$asdf" -> (VAR_REF asdf) "${asdf}" -> (VAR_REF asdf) "${asdf:-foo}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING foo))) "${asdf:-public_html}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL asdf (STRING public_html))) "${asdf='foo'}" -> (VAR_REF (ASSIGN_DEFAULT_WHEN_UNSET asdf (STRING (SINGLE_QUOTED_STRING 'foo')))) -"${asdf:=}" -> (VAR_REF (ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL asdf STRING)) +//"${asdf:=}" -> (VAR_REF (ASSIGN_DEFAULT_WHEN_UNSET_OR_NULL asdf STRING)) "${bar:7}" -> (VAR_REF (OFFSET bar 7)) "${bar: -10}" -> (VAR_REF (OFFSET bar (MINUS_SIGN 10))) "${bar:(-10 + 5)}" -> (VAR_REF (OFFSET bar (+ (MINUS_SIGN 10) 5))) @@ -41,7 +41,7 @@ var_ref: "${foo##bar}" -> (VAR_REF (REPLACE_AT_START foo (STRING bar))) "${foo%bar}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING bar))) "${foo%%bar}" -> (VAR_REF (REPLACE_AT_END foo (STRING bar))) -"${foo%; *}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING ; MATCH_ALL))) +//"${foo%; *}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING ; MATCH_ALL))) "${foo%/}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING /))) "${this/is/pattern}"->(VAR_REF (REPLACE_FIRST this (STRING is) (STRING pattern))) //Test positional/special parameters @@ -60,13 +60,13 @@ var_ref: "${$}" -> (VAR_REF $) "${PV//./_}" -> (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _))) "${PV// }" -> (VAR_REF (REPLACE_ALL PV (STRING ))) -"${PV//[-._]/}" -> (VAR_REF (REPLACE_ALL PV (STRING (MATCH_ANY - . _)) STRING)) +//"${PV//[-._]/}" -> (VAR_REF (REPLACE_ALL PV (STRING (MATCH_ANY - . _)) STRING)) "${PV/${pattern}/${replace}}" -> (VAR_REF (REPLACE_FIRST PV (STRING (VAR_REF pattern)) (STRING (VAR_REF replace)))) "${PV/#foo/bar}" -> (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING bar))) "${PV/%foo/bar}" -> (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar))) "${PN/%spaces /more }" -> (VAR_REF (REPLACE_AT_END PN (STRING spaces ) (STRING more ))) "${PN/wrong#/#correct}" -> (VAR_REF (REPLACE_FIRST PN (STRING wrong #) (STRING # correct))) -var_def: +variable_definition_atom: "MY_PN=${PN/asterisk-}" -> (= MY_PN (STRING (VAR_REF (REPLACE_FIRST PN (STRING asterisk -))))) "MY_PN=1abc" -> (= MY_PN (STRING 1 abc)) |