summaryrefslogtreecommitdiffstats
path: root/eshtrans
diff options
context:
space:
mode:
authorP. 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)
commit025ec1a5caee267ccf655bb9ddc3320936f69d57 (patch)
treeaead951e7ba7a9fadd3e945951debfbb2f318644 /eshtrans
parent38730b344f7027fa89097ca660300802842a18aa (diff)
downloadeggshell-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.esh7
-rw-r--r--eshtrans/main.esh8
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 "\"'\""
}