diff options
Diffstat (limited to 'bashast')
-rw-r--r-- | bashast/bashast.g | 3 | ||||
-rw-r--r-- | bashast/gunit/fname.gunit | 2 | ||||
-rw-r--r-- | bashast/libbashWalker.g | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g index c836047..f7ce358 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -784,7 +784,7 @@ ns_string_part |OTHER|EQUALS|PCT|PCTPCT|PLUS|MINUS|DOT|DOTDOT|COLON |TILDE|LSQUARE|RSQUARE|CARET|POUND|COMMA|EXPORT|LOCAL|AT // Escaped characters - |ESC_RPAREN|ESC_LPAREN|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK + |ESC_RPAREN|ESC_LPAREN|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK|ESC_DQUOTE // The following is for filename expansion |TIMES|QMARK; @@ -1126,6 +1126,7 @@ AMP_RSHIFT : '&>>'; SEMIC : ';'; DOUBLE_SEMIC : ';;'; PIPE : '|'; +ESC_DQUOTE : '\\"'; DQUOTE : '"' { if(LA(-1) != '\\') double_quoted = !double_quoted; }; SQUOTE : { double_quoted }? => '\''; SINGLE_QUOTED_STRING_TOKEN : { !double_quoted }? => '\'' .* '\''; diff --git a/bashast/gunit/fname.gunit b/bashast/gunit/fname.gunit index 9ac0b25..65bb614 100644 --- a/bashast/gunit/fname.gunit +++ b/bashast/gunit/fname.gunit @@ -77,4 +77,4 @@ condition_expr: "[[ x == ab!(gh|i) ]]" -> (KEYWORD_TEST (MATCH_PATTERN (STRING x) (STRING ab (EXTENDED_MATCH_NONE (BRANCH gh) (BRANCH i))))) double_quoted_string: -"\"\\\\\"\$\`\"" -> (DOUBLE_QUOTED_STRING \ " \$ \`) +"\"\\\\\"\$\`\"" -> (DOUBLE_QUOTED_STRING \ \" \$ \`) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index 5d5b557..fb1ca55 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -446,6 +446,7 @@ options {backtrack = true;} :ESC_RPAREN { $libbash_value = ")"; } |ESC_LPAREN { $libbash_value = "("; } |ESC_DOLLAR { $libbash_value = "$"; } + |ESC_DQUOTE { $libbash_value = "\""; } |ESC_GT { $libbash_value = ">"; } |ESC_LT { $libbash_value = "<"; } |ESC_TICK { $libbash_value = "`"; } |