aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2012-02-23 11:24:05 +0800
committerMu Qiao <qiaomuf@gentoo.org>2012-02-23 11:27:12 +0800
commitb921511820ee4116b4f1f2746bb90e6b859ae1c8 (patch)
tree28a5cf7bbccd7f93c8e9b1888e6e7bd3bc2a830b /bashast/gunit/cond_main.gunit
parentBuild: add more information to libbash.pc.in (diff)
downloadlibbash-b921511820ee4116b4f1f2746bb90e6b859ae1c8.tar.gz
libbash-b921511820ee4116b4f1f2746bb90e6b859ae1c8.tar.bz2
libbash-b921511820ee4116b4f1f2746bb90e6b859ae1c8.zip
Parser: respect operator precedence in keyword test
Diffstat (limited to 'bashast/gunit/cond_main.gunit')
-rw-r--r--bashast/gunit/cond_main.gunit2
1 files changed, 2 insertions, 0 deletions
diff --git a/bashast/gunit/cond_main.gunit b/bashast/gunit/cond_main.gunit
index fbf785e..5ecd024 100644
--- a/bashast/gunit/cond_main.gunit
+++ b/bashast/gunit/cond_main.gunit
@@ -37,3 +37,5 @@ condition_expr:
"[[ a<b ]]" -> (KEYWORD_TEST (< (STRING a) (STRING b)))
"[[ a>b ]]" -> (KEYWORD_TEST (> (STRING a) (STRING b)))
"[[ ${VIRTUALX_REQUIRED} == always || ${VIRTUALX_REQUIRED} == test ]]" -> (KEYWORD_TEST (|| (MATCH_PATTERN (STRING (VAR_REF VIRTUALX_REQUIRED)) (STRING always)) (MATCH_PATTERN (STRING (VAR_REF VIRTUALX_REQUIRED)) (STRING test))))
+"[[ a == b || c == d && e == f ]]" -> (KEYWORD_TEST (|| (MATCH_PATTERN (STRING a) (STRING b)) (&& (MATCH_PATTERN (STRING c) (STRING d)) (MATCH_PATTERN (STRING e) (STRING f)))))
+"[[ a == b && c == d || e == f ]]" -> (KEYWORD_TEST (|| (&& (MATCH_PATTERN (STRING a) (STRING b)) (MATCH_PATTERN (STRING c) (STRING d))) (MATCH_PATTERN (STRING e) (STRING f))))