summaryrefslogtreecommitdiffstats
path: root/parsing
diff options
context:
space:
mode:
Diffstat (limited to 'parsing')
-rw-r--r--parsing/lexer.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/parsing/lexer.sh b/parsing/lexer.sh
index 5c3f6c5..924964e 100644
--- a/parsing/lexer.sh
+++ b/parsing/lexer.sh
@@ -214,20 +214,19 @@ next_io()
next_word()
{
local res=
- local lineno_offset=
local word=
if ! res="$(scan_word false)"; then
exit 1
fi
- lineno_offset=${res%%${RS}*}
+ ln_off=${res%%${RS}*}
res="${res#*${RS}}"
c="${res%%${RS}*}"
res="${res#*${RS}}"
word="${res%%${RS}*}"
# We must advance lineno because scan_word() was run in a subshell.
- lineno=$((${lineno} + ${lineno_offset}))
+ lineno=$((${lineno} + ${ln_off}))
tok="T_WORD${US}${word}"
}
@@ -242,7 +241,6 @@ scan_word()
local word=
local quoted=
local lines=
- local lineno_offset=
local wordexp=
word=''
@@ -273,14 +271,14 @@ scan_word()
if ! res=$(scan_wordexp); then
exit 1
fi
- lineno_offset=${res%%${RS}*}
+ ln_off=${res%%${RS}*}
res="${res#*${RS}}"
c="${res%%${RS}*}"
res="${res#*${RS}}"
wordexp="${res%%${RS}*}"
# We must advance lineno because scan_wordexp()
# was run in a subshell.
- lineno=$((${lineno} + ${lineno_offset}))
+ lineno=$((${lineno} + ${ln_off}))
word="${word}${wordexp}"
# scan_wordexp() leaves behind an unused
# character, so we should skip the lgetc() call
@@ -330,9 +328,8 @@ scan_word()
scan_wordexp()
{
local res=
- local param=
- local word=
local toks=
+ local param=
wordexp=''
ln_off=0
@@ -392,6 +389,7 @@ scan_wordexp_param_brace()
local mod=
local res=
local param=
+ local word=
ln_off=0
mod=true