From 39854f9aa993ef08a49d5ad5d3b6d69d3371e8e3 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 27 Feb 2016 21:56:21 -0500 Subject: eshtrans/frontend: Fix lungetc() --- (limited to 'eshtrans/frontend') diff --git a/eshtrans/frontend/lexer.esh b/eshtrans/frontend/lexer.esh index f43b47d..6120128 100644 --- a/eshtrans/frontend/lexer.esh +++ b/eshtrans/frontend/lexer.esh @@ -92,14 +92,16 @@ lgetc() c='' else eval "c=\${lbufv_${lbufi}}" + #echo "LGETC:$lineno: $lbufi '$c'" >&2 lbufi=$((${lbufi} + 1)) fi } lungetc() { - lbufi=$((${lbufi} - 2)) + lbufi=$((${lbufi} - 1)) eval "c=\${lbufv_${lbufi}}" + #echo "LUNGETC:$lineno: $lbufi '$c'" >&2 lbufi=$((${lbufi} + 1)) } @@ -110,6 +112,7 @@ lsetc() else lbufi=$((${lbufi} - 1)) eval "c=\${lbufv_${lbufi}}" + #echo "LSETC:$lineno: $lbufi '$c'" >&2 lbufi=$((${lbufi} + 1)) fi } -- cgit v0.9.1