summaryrefslogtreecommitdiffstats
path: root/eshtrans
diff options
context:
space:
mode:
Diffstat (limited to 'eshtrans')
-rw-r--r--eshtrans/frontend/lexer.esh20
1 files changed, 7 insertions, 13 deletions
diff --git a/eshtrans/frontend/lexer.esh b/eshtrans/frontend/lexer.esh
index 224cef0..0c13836 100644
--- a/eshtrans/frontend/lexer.esh
+++ b/eshtrans/frontend/lexer.esh
@@ -30,7 +30,6 @@ here_queue=
here_awaiting_end=
here_awaiting_word=
tok=
-tokens=
#dbg()
#{
@@ -580,10 +579,10 @@ scan_wordexp()
"${c}")"; then
exit 1
fi
- ln_off=${res%%${RS}*}
- res="${res#*${RS}}"
- c="${res%%${RS}*}"
- res="${res#*${RS}}"
+ c="${res##*${RS}}"
+ res="${res%${RS}*}"
+ ln_off=${res##*${RS}}
+ res="${res%${RS}*}"
ln_off=$((${ln_off} - ${lineno}))
lineno=$((${lineno} + ${ln_off}))
wordexp="\$(${SOH}C${STX}${res}"
@@ -848,7 +847,6 @@ run_sublexer()
here_queue=''
here_awaiting_end=false
here_awaiting_word=false
- tokens=''
c="${ch}"
next
@@ -864,7 +862,7 @@ run_sublexer()
;;
esac
- printf "%d${RS}%c${RS}%s" ${lineno} "${c}" "${tokens}"
+ printf "${RS}%d${RS}%c" ${lineno} "${c}"
return 0
}
@@ -885,7 +883,6 @@ run_lexer()
here_queue=''
here_awaiting_end=false
here_awaiting_word=false
- tokens=''
# Read the first character and recognize the first token.
lgetc
@@ -899,9 +896,6 @@ run_lexer()
synexp ''
fi
- # Return the tokens.
- printf '%s' "${tokens}"
-
return 0
}
@@ -1019,7 +1013,7 @@ accept()
esac
#dbg "accept $t"
- tokens="${tokens}${tok}${RS}"
+ printf '%s' "${tok}${RS}"
next
return 0
}
@@ -1041,6 +1035,6 @@ inject()
local t="${1}"
shift 1
- tokens="${tokens}${t}${RS}"
+ printf '%s' "${t}${RS}"
return 0
}