diff options
-rw-r--r-- | parsing/lexer.sh | 8 | ||||
-rw-r--r-- | parsing/parse.sh | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/parsing/lexer.sh b/parsing/lexer.sh index aa72ec1..c856d99 100644 --- a/parsing/lexer.sh +++ b/parsing/lexer.sh @@ -109,7 +109,7 @@ next() continue ;; esac - next_word + next_word \\ return ;; '#') @@ -172,7 +172,7 @@ next() return ;; *) - next_word + next_word '' return ;; esac @@ -327,6 +327,8 @@ next_io() next_word() { + local prev_c="${1}" + shift 1 local res= local word= @@ -337,7 +339,7 @@ next_word() res="${res#*${RS}}" c="${res%%${RS}*}" res="${res#*${RS}}" - word="${res%%${RS}*}" + word="${prev_c}${res%%${RS}*}" # We must advance lineno because scan_word() was run in a subshell. lineno=$((${lineno} + ${ln_off})) diff --git a/parsing/parse.sh b/parsing/parse.sh index ddcdd97..600a247 100644 --- a/parsing/parse.sh +++ b/parsing/parse.sh @@ -660,4 +660,8 @@ try() #try 'foo <<-EOF' "${HT}bar" "${HT}EOF" #try 'foo <<EOF' '$(bar)' 'EOF' try 'foo <<E"O"F' '$(bar)' 'EOF' +try 'foo <<"EOF"' '$(bar)' 'EOF' +try 'foo <<E\OF' '$(bar)' 'EOF' +try 'foo <<\EOF' '$(bar)' 'EOF' #try 'foo <<EOF1; bar <<EOF2' 'baz' 'EOF1' 'qux' 'EOF2' +try '\foo' |