diff options
Diffstat (limited to 'eshtrans')
-rw-r--r-- | eshtrans/frontend/lexer.esh | 4 | ||||
-rw-r--r-- | eshtrans/main.esh | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/eshtrans/frontend/lexer.esh b/eshtrans/frontend/lexer.esh index 46ba310..92c806c 100644 --- a/eshtrans/frontend/lexer.esh +++ b/eshtrans/frontend/lexer.esh @@ -458,6 +458,7 @@ scan_word() # We must advance lineno because scan_wordexp() # was run in a subshell. lineno=$((${lineno} + ${ln_off})) + lines=$((${lines} + ${ln_off})) word="${word}${res}" # scan_wordexp() leaves behind an unused # character, so we should skip the lgetc() call @@ -583,7 +584,8 @@ scan_wordexp() res="${res#*${RS}}" c="${res%%${RS}*}" res="${res#*${RS}}" - lineno=${ln_off} + ln_off=$((${ln_off} - ${lineno})) + lineno=$((${lineno} + ${ln_off})) wordexp="\$(${SOH}C${STX}${res}" wordexp="${wordexp}${ETX})" # ")" is recognized in run_sublexer(). diff --git a/eshtrans/main.esh b/eshtrans/main.esh index b0bcf53..0a0b929 100644 --- a/eshtrans/main.esh +++ b/eshtrans/main.esh @@ -116,6 +116,8 @@ main() #try 'foo 2>bar' #try '2>bar' #try '2 foo' +dbg=true +try 'foo $(bar \' 'baz \' 'qux) &&' # Line number testing - sh_codegen "$(esh_parse "${1}" <"${1}")" +# sh_codegen "$(esh_parse "${1}" <"${1}")" } |