aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-07-20 19:52:21 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-07-20 23:08:32 +0800
commitcd7ac69edee15151ad178fc075817d126e77fa21 (patch)
tree129f8d11546c924bf5a0a02cef3cda627a460728 /bashast
parentParser: fix parameter expansion value (diff)
downloadlibbash-cd7ac69edee15151ad178fc075817d126e77fa21.tar.gz
libbash-cd7ac69edee15151ad178fc075817d126e77fa21.tar.bz2
libbash-cd7ac69edee15151ad178fc075817d126e77fa21.zip
Parser: remove backtracking for double quoted string
Diffstat (limited to 'bashast')
-rw-r--r--bashast/bashast.g13
1 files changed, 6 insertions, 7 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g
index 3ca2bf8..f712f2e 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -611,13 +611,12 @@ quoted_string
double_quoted_string
: DQUOTE double_quoted_string_part* DQUOTE -> ^(DOUBLE_QUOTED_STRING double_quoted_string_part*);
double_quoted_string_part
-options{ backtrack = true; memoize = true; }
- : variable_reference
- | command_substitution
- | arithmetic_expansion
- | ESC DQUOTE -> DQUOTE
- | ESC TICK -> TICK
- | ESC DOLLAR -> DOLLAR
+ : (DOLLAR (LBRACE|name|num|TIMES|AT|POUND|QMARK|MINUS|DOLLAR|BANG)) => variable_reference
+ | (command_substitution) => command_substitution
+ | (DOLLAR (LLPAREN|LSQUARE)) => arithmetic_expansion
+ | (ESC DQUOTE) => ESC DQUOTE -> DQUOTE
+ | (ESC TICK) => ESC TICK -> TICK
+ | (ESC DOLLAR) => ESC DOLLAR -> DOLLAR
| ~(TICK|DQUOTE);
string_part