aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bashast/bashast.g4
-rw-r--r--bashast/libbashWalker.g2
-rw-r--r--scripts/command_execution.bash1
3 files changed, 6 insertions, 1 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g
index 3ce2c8e..61c7e57 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -786,7 +786,7 @@ ns_string_part
|OTHER|EQUALS|PCT|PCTPCT|PLUS|MINUS|DOT|DOTDOT|COLON
|TILDE|LSQUARE|RSQUARE|CARET|POUND|COMMA|EXPORT|LOCAL|DECLARE|AT
// Escaped characters
- |ESC_RPAREN|ESC_LPAREN|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK|ESC_DQUOTE
+ |ESC_RPAREN|ESC_LPAREN|ESC_RSQUARE|ESC_LSQUARE|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK|ESC_DQUOTE
// The following is for filename expansion
|TIMES|QMARK;
@@ -1160,6 +1160,8 @@ LOGICOR : '||';
CONTINUE_LINE : (ESC EOL)+{$channel=HIDDEN;};
ESC_RPAREN : ESC RPAREN;
ESC_LPAREN : ESC LPAREN;
+ESC_RSQUARE : ESC RSQUARE;
+ESC_LSQUARE : ESC LSQUARE;
ESC_DOLLAR : ESC DOLLAR;
ESC_TICK : ESC TICK;
COMMAND_SUBSTITUTION_PAREN
diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g
index 27377de..9c85f9d 100644
--- a/bashast/libbashWalker.g
+++ b/bashast/libbashWalker.g
@@ -462,6 +462,8 @@ options {backtrack = true;}
}
:ESC_RPAREN { $libbash_value = ")"; }
|ESC_LPAREN { $libbash_value = "("; }
+ |ESC_RSQUARE { $libbash_value = "]"; }
+ |ESC_LSQUARE { $libbash_value = "["; }
|ESC_DOLLAR { $libbash_value = "$"; }
|ESC_DQUOTE { $libbash_value = "\""; }
|ESC_GT { $libbash_value = ">"; }
diff --git a/scripts/command_execution.bash b/scripts/command_execution.bash
index 3b275ca..1cc837b 100644
--- a/scripts/command_execution.bash
+++ b/scripts/command_execution.bash
@@ -96,6 +96,7 @@ eval abc+=\( \"\$@\" \)
declare MOZILLA_FIVE_HOME="/usr/share/${PN}"
declare foo=23 empty bar=42
echo $MOZILLA_FIVE_HOME $foo $lol $bar
+echo \(\)\[\]\$\"\>
FILE=scripts/input_output_test
echo foo > $FILE