aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-07-20 20:11:15 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-07-20 23:08:32 +0800
commit4fe9d8a7e2655c54dccc651664eda0f22b761707 (patch)
treef183cc327bbfbab0a8c3384047cf8f2f877d7917 /bashast/gunit
parentParser: remove backtracking for double quoted string (diff)
downloadlibbash-4fe9d8a7e2655c54dccc651664eda0f22b761707.tar.gz
libbash-4fe9d8a7e2655c54dccc651664eda0f22b761707.tar.bz2
libbash-4fe9d8a7e2655c54dccc651664eda0f22b761707.zip
Parser: add rules to perform bash expansions
The rule will be called in the walker grammar to perform bash expansions on raw strings.
Diffstat (limited to 'bashast/gunit')
-rw-r--r--bashast/gunit/expansions.gunit3
1 files changed, 3 insertions, 0 deletions
diff --git a/bashast/gunit/expansions.gunit b/bashast/gunit/expansions.gunit
index 24c3702..4608994 100644
--- a/bashast/gunit/expansions.gunit
+++ b/bashast/gunit/expansions.gunit
@@ -30,3 +30,6 @@ echo $each
done" -> (LIST (COMMAND (for each (STRING (COMMAND_SUB `ls |grep output`)) (LIST (COMMAND (STRING echo) (STRING (VAR_REF each)))))))
"wc <(cat /usr/share/dict/linux.words)" -> (LIST (COMMAND (STRING wc) (PROCESS_SUBSTITUTION < (LIST (COMMAND (STRING cat) (STRING / usr / share / dict / linux . words))))))
*/
+
+all_expansions:
+"abc $(ab) ${ab} $((ab)) `ab` \"ab\" 'ab'" -> (STRING abc (COMMAND_SUB $(ab)) (VAR_REF ab) (ARITHMETIC_EXPRESSION (VAR_REF ab)) (COMMAND_SUB `ab`) (DOUBLE_QUOTED_STRING ab) 'ab')