aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-07-21 22:16:18 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-08-02 15:46:29 +0800
commit97ed8ee45a88e47196024528b3da0c75077f05ba (patch)
tree3a73fe9d5b8ea8dcea21610c266be8af3d735599
parentParser: remove tokens for += and -= (diff)
downloadlibbash-97ed8ee45a88e47196024528b3da0c75077f05ba.tar.gz
libbash-97ed8ee45a88e47196024528b3da0c75077f05ba.tar.bz2
libbash-97ed8ee45a88e47196024528b3da0c75077f05ba.zip
Parser: allow filename expansion characters
-rw-r--r--bashast/bashast.g4
-rw-r--r--bashast/gunit/fname.gunit1
2 files changed, 4 insertions, 1 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g
index 0a9557e..2709fc5 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -662,7 +662,9 @@ ns_string_part
|OTHER|EQUALS|PCT|PCTPCT|PLUS|MINUS|DOT|DOTDOT|COLON|TEST_EXPR
|TILDE|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN
|LSHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN|LSQUARE|RSQUARE
- |OR_ASSIGN|CARET|POUND|POUNDPOUND|COMMA|EXPORT|LOCAL|AT;
+ |OR_ASSIGN|CARET|POUND|POUNDPOUND|COMMA|EXPORT|LOCAL|AT
+ // The following is for filename expansion
+ |TIMES|QMARK;
escaped_character
: ESC
diff --git a/bashast/gunit/fname.gunit b/bashast/gunit/fname.gunit
index f07b3db..3d60bc2 100644
--- a/bashast/gunit/fname.gunit
+++ b/bashast/gunit/fname.gunit
@@ -20,6 +20,7 @@ gunit java_libbash;
string_expr:
"+%Y%m%d" -> (STRING + % Y % m % d)
+"/tmp/a?b*" -> (STRING / tmp / a ? b *)
"\"http://www.gnu.org/software/autoconf/autoconf.html\"" -> (STRING (DOUBLE_QUOTED_STRING http : / / www . gnu . org / software / autoconf / autoconf . html))
"\"http://dev.gentoo.org/~mpagano/genpatches\"" -> (STRING (DOUBLE_QUOTED_STRING http : / / dev . gentoo . org / ~ mpagano / genpatches))
"\"\"" -> (STRING DOUBLE_QUOTED_STRING)