diff options
author | André Aparício <aparicio99@gmail.com> | 2012-07-27 04:02:20 +0100 |
---|---|---|
committer | André Aparício <aparicio99@gmail.com> | 2012-08-03 04:07:25 +0100 |
commit | 5a31b0886ca36364c34ed04011bcdac211bb5bd7 (patch) | |
tree | 48f815a2787cc79e541dcc61650faa8a73ec3690 /bashast | |
parent | Walker: Fix appending to an array of size 1 (diff) | |
download | libbash-5a31b0886ca36364c34ed04011bcdac211bb5bd7.tar.gz libbash-5a31b0886ca36364c34ed04011bcdac211bb5bd7.tar.bz2 libbash-5a31b0886ca36364c34ed04011bcdac211bb5bd7.zip |
Parser: Multiline string declaration
Support quoted strings line breaks in builtin variable definitions
Diffstat (limited to 'bashast')
-rw-r--r-- | bashast/bashast.g | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g index 4438b8c..0d59e8c 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -466,15 +466,22 @@ array_atom builtin_variable_definition_item scope { int parens; +#ifdef OUTPUT_C + bool dquotes; +#else + boolean dquotes; +#endif } @init { $builtin_variable_definition_item::parens = 0; + $builtin_variable_definition_item::dquotes = false; } : ( (LPAREN) => LPAREN { ++$builtin_variable_definition_item::parens; } |(RPAREN) => RPAREN { --$builtin_variable_definition_item::parens; } + |(DQUOTE) => DQUOTE { $builtin_variable_definition_item::dquotes = ! $builtin_variable_definition_item::dquotes; } |(~(EOL|SEMIC)) => expansion_base - | {LA(1) == EOL && $builtin_variable_definition_item::parens > 0}? => EOL + | {LA(1) == EOL && $builtin_variable_definition_item::parens > 0 || $builtin_variable_definition_item::dquotes}? => EOL )+; #ifdef OUTPUT_C |