aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-07-28 16:44:53 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-08-02 15:52:19 +0800
commit7ee597c631c9ece2d73e81df0726c6dbc8288fd7 (patch)
tree371ecd19a51e69a7a6a9c7117328cac53737df9f /bashast/gunit
parentParser: support ${?} (diff)
downloadlibbash-7ee597c631c9ece2d73e81df0726c6dbc8288fd7.tar.gz
libbash-7ee597c631c9ece2d73e81df0726c6dbc8288fd7.tar.bz2
libbash-7ee597c631c9ece2d73e81df0726c6dbc8288fd7.zip
Parser: make spaces around < and > optional
Only < and > is optional for keyword test. Some unit tests in cond_main.gunit are fixed.
Diffstat (limited to 'bashast/gunit')
-rw-r--r--bashast/gunit/cond_main.gunit8
1 files changed, 5 insertions, 3 deletions
diff --git a/bashast/gunit/cond_main.gunit b/bashast/gunit/cond_main.gunit
index e4810a9..7b0aee5 100644
--- a/bashast/gunit/cond_main.gunit
+++ b/bashast/gunit/cond_main.gunit
@@ -31,6 +31,8 @@ condition_expr:
"[ a == b ]" -> (BUILTIN_TEST (= (STRING a) (STRING b)))
"[ a != b ]" -> (BUILTIN_TEST (NOT_EQUALS (STRING a) (STRING b)))
"[[ \"${DISTUTILS_SRC_TEST}\" =~ ^(setup\.py|nosetests|py\.test|trial(\ .*)?)$ ]]" -> (KEYWORD_TEST (MATCH_REGULAR_EXPRESSION (STRING (DOUBLE_QUOTED_STRING (VAR_REF DISTUTILS_SRC_TEST))) (STRING ^ ( setup \ . py | nosetests | py \ . test | trial ( \ . * ) ? ) $)))
-"[ -n "$FROM_LANG" -a -n "$TO_LANG" ]" -> (BUILTIN_TEST (BUILTIN_LOGIC a (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF FROM_LANG)))) (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF TO_LANG))))))
-"[ -n "$FROM_LANG" -o -n "$TO_LANG" ]" -> (BUILTIN_TEST (BUILTIN_LOGIC o (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF FROM_LANG)))) (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF TO_LANG))))))
-"[[ "${element}" =~ (^[^[:space:]]+\ .) ]]" -> (KEYWORD_TEST (MATCH_REGULAR_EXPRESSION (STRING (DOUBLE_QUOTED_STRING (VAR_REF element))) (STRING ( ^ [ ^ [ : space : ] ] + \ . ))))
+"[ -n \"$FROM_LANG\" -a -n \"$TO_LANG\" ]" -> (BUILTIN_TEST (BUILTIN_LOGIC a (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF FROM_LANG)))) (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF TO_LANG))))))
+"[ -n \"$FROM_LANG\" -o -n \"$TO_LANG\" ]" -> (BUILTIN_TEST (BUILTIN_LOGIC o (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF FROM_LANG)))) (n (STRING (DOUBLE_QUOTED_STRING (VAR_REF TO_LANG))))))
+"[[ \"${element}\" =~ (^[^[:space:]]+\ .) ]]" -> (KEYWORD_TEST (MATCH_REGULAR_EXPRESSION (STRING (DOUBLE_QUOTED_STRING (VAR_REF element))) (STRING ( ^ [ ^ [ : space : ] ] + \ . ))))
+"[[ a<b ]]" -> (KEYWORD_TEST (< (STRING a) (STRING b)))
+"[[ a>b ]]" -> (KEYWORD_TEST (> (STRING a) (STRING b)))