diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-02-21 12:46:20 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-02-21 12:46:20 (EST) |
commit | 025ec1a5caee267ccf655bb9ddc3320936f69d57 (patch) | |
tree | aead951e7ba7a9fadd3e945951debfbb2f318644 /eshtrans | |
parent | 38730b344f7027fa89097ca660300802842a18aa (diff) | |
download | eggshell-025ec1a5caee267ccf655bb9ddc3320936f69d57.zip eggshell-025ec1a5caee267ccf655bb9ddc3320936f69d57.tar.gz eggshell-025ec1a5caee267ccf655bb9ddc3320936f69d57.tar.bz2 |
eshtrans/frontend: Fix handling of single quote in double quotes
Diffstat (limited to 'eshtrans')
-rw-r--r-- | eshtrans/frontend/lexer.esh | 7 | ||||
-rw-r--r-- | eshtrans/main.esh | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/eshtrans/frontend/lexer.esh b/eshtrans/frontend/lexer.esh index 6775bbc..d274076 100644 --- a/eshtrans/frontend/lexer.esh +++ b/eshtrans/frontend/lexer.esh @@ -498,6 +498,13 @@ scan_word() ;; \') word="${word}${c}" + if ${quoted}; then + case "${prev_c}" in + '') lgetc;; + *) c="${tmp_c}"; prev_c='';; + esac + continue + fi while :; do case "${prev_c}" in '') lgetc;; diff --git a/eshtrans/main.esh b/eshtrans/main.esh index 0177774..b637695 100644 --- a/eshtrans/main.esh +++ b/eshtrans/main.esh @@ -102,6 +102,10 @@ main() #try '# foo' 'bar' #try '' 'foo' #try '\\ foo' -try '$(($foo + 1))' -try '$((1 + $foo))' +#try '$(($foo + 1))' +#try '$((1 + $foo))' +#try "foo '\`'" +#try 'foo "`"' +dbg=true +try "\"'\"" } |