summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eshtrans/backend/codegen.esh15
1 files changed, 14 insertions, 1 deletions
diff --git a/eshtrans/backend/codegen.esh b/eshtrans/backend/codegen.esh
index 247618f..42b714a 100644
--- a/eshtrans/backend/codegen.esh
+++ b/eshtrans/backend/codegen.esh
@@ -42,11 +42,13 @@ codegen_sub()
{
local array="${1}"
shift 1
+ local print_spc=
local ionum=
local fname=
local static=
local static_fname=
+ print_spc=false
ionum=false
fname=''
static=false
@@ -54,6 +56,17 @@ codegen_sub()
IFS="${RS}"
for t in ${array}; do
+ if ${print_spc}; then
+ case "${t%${US}*}" in
+ T_NEWLINE)
+ ;;
+ *)
+ printf ' '
+ ;;
+ esac
+ print_spc=false
+ fi
+
# Handle I/O number false positives.
if ${ionum}; then
case "${t%${US}*}" in
@@ -130,7 +143,7 @@ codegen_sub()
ionum=true
;;
*)
- printf ' '
+ print_spc=true
;;
esac
done