summaryrefslogtreecommitdiffstats
path: root/eshtrans/frontend/lexer.esh
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-02-28 01:47:06 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-02-28 01:47:06 (EST)
commit9868dcf4746ff021b7de95c7eab7cc8baa3cd616 (patch)
treef30f95c171d5d7aa14425341312985535bbe28bd /eshtrans/frontend/lexer.esh
parent46a5273845a75860508aef036467a8c6091f58cf (diff)
downloadeggshell-9868dcf4746ff021b7de95c7eab7cc8baa3cd616.zip
eggshell-9868dcf4746ff021b7de95c7eab7cc8baa3cd616.tar.gz
eggshell-9868dcf4746ff021b7de95c7eab7cc8baa3cd616.tar.bz2
Revert "Revert "eshtrans/frontend: Comment out dbg() and its calls""
This reverts commit 46a5273845a75860508aef036467a8c6091f58cf.
Diffstat (limited to 'eshtrans/frontend/lexer.esh')
-rw-r--r--eshtrans/frontend/lexer.esh32
1 files changed, 16 insertions, 16 deletions
diff --git a/eshtrans/frontend/lexer.esh b/eshtrans/frontend/lexer.esh
index 4c835cc..a9aaa6d 100644
--- a/eshtrans/frontend/lexer.esh
+++ b/eshtrans/frontend/lexer.esh
@@ -18,7 +18,7 @@
# along with the Eggshell Compiler. If not, see
# <http://www.gnu.org/licenses/>.
-dbg=false
+#dbg=false
fname=
lineno=
@@ -31,12 +31,12 @@ here_awaiting_end=
here_awaiting_word=
tok=
-dbg()
-{
- if ${dbg}; then
- printf 'DEBUG: %s\n' "${@}" >&2
- fi
-}
+#dbg()
+#{
+# if ${dbg}; then
+# printf 'DEBUG: %s\n' "${@}" >&2
+# fi
+#}
#
# Error handling (used by scanning and interface functions)
@@ -103,7 +103,7 @@ next()
return
fi
while :; do
- dbg "parsing char '$c' at lineno $lineno"
+ #dbg "parsing char '$c' at lineno $lineno"
case "${c}" in
'')
lgetc
@@ -181,7 +181,7 @@ next()
return
;;
esac
- dbg T_SEMI
+ #dbg T_SEMI
tok=T_SEMI
return
;;
@@ -413,7 +413,7 @@ scan_word()
esac
while :; do
- dbg "parsing word char '$c' at lineno $lineno"
+ #dbg "parsing word char '$c' at lineno $lineno"
case "${c}" in
'')
break
@@ -470,13 +470,13 @@ scan_word()
break
;;
\\)
- dbg 'first backslash in word'
+ #dbg 'first backslash in word'
word="${word}${c}"
case "${prev_c}" in
'') lgetc;;
*) c="${tmp_c}"; prev_c='';;
esac
- dbg "next char: '$c'"
+ #dbg "next char: '$c'"
case "${c}" in '')
# Bash, ksh93, mksh, and zsh ignore a
# backslash at the end of a file, but
@@ -712,7 +712,7 @@ scan_wordexp_param_brace()
# subshell.
lineno=$((${lineno} + ${ln_off}))
wordexp="${wordexp}${res}"
- dbg "param mod word: '$res'"
+ #dbg "param mod word: '$res'"
fi
# Check for right brace.
@@ -905,13 +905,13 @@ accept()
shift 1
local rw=
- dbg "looking for $t, current tok ${tok%%${US}*}"
+ #dbg "looking for $t, current tok ${tok%%${US}*}"
case "${t}" in
T_IF|T_THEN|T_ELSE|T_ELIF|T_FI|T_DO|T_DONE|\
T_CASE|T_ESAC|T_WHILE|T_UNTIL|T_FOR|\
T_LBRACE|T_RBRACE|T_BANG|T_IN|\
T_STATIC|T_LOCAL|T_RETURN)
- dbg "looking for reserved word $t, have '$tok'"
+ #dbg "looking for reserved word $t, have '$tok'"
if ! [ "x${tok%%${US}*}" = "x${t}" ]; then
# Reserved words are recognized as literal
# T_WORDs.
@@ -1012,7 +1012,7 @@ accept()
;;
esac
- dbg "accept $t"
+ #dbg "accept $t"
printf '%s' "${tok}${RS}"
next
return 0