From 5a64eb980d99b7c06522bb9062e5eb29ec960ebe Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 23 Feb 2016 12:24:38 -0500 Subject: eshtrans/backend: Don't write trailing spaces --- 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 -- cgit v0.9.1