summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eshtrans/backend/codegen.esh6
-rw-r--r--eshtrans/main.esh7
2 files changed, 8 insertions, 5 deletions
diff --git a/eshtrans/backend/codegen.esh b/eshtrans/backend/codegen.esh
index dea169b..1b2d168 100644
--- a/eshtrans/backend/codegen.esh
+++ b/eshtrans/backend/codegen.esh
@@ -35,7 +35,11 @@ codegen_sub()
for t in ${array}; do
toktext "${t}"
case "${t%${US}*}" in
- T_NEWLINE)
+ T_NEWLINE|T_LPAREN)
+ # Indenting lines can mess up here-documents.
+ # Adding a space after "(" can mess up function
+ # definitions (on zsh at least, while other
+ # shells accept the space).
;;
*)
printf ' '
diff --git a/eshtrans/main.esh b/eshtrans/main.esh
index 9373ff6..8b94861 100644
--- a/eshtrans/main.esh
+++ b/eshtrans/main.esh
@@ -60,14 +60,14 @@ main()
#try 'foo `bar`'
#try 'foo &&'
#try '{ foo; }'
-#try '( foo )'
+try '( foo )'
#try 'for i in 1 2 3; do stuff; done'
#try 'if foo; then bar; fi'
#try 'if foo; then bar; elif baz; then qux; else quux; fi'
#try 'if ; then ; fi'
#try 'while foo; do bar; done'
#try 'while ; do ; done'
-#try 'foo(){ bar; }'
+try 'foo(){ bar; }'
#try 'case foo in bar) baz;; (qux) quux;; quux);; esac'
#try 'foo bar ( baz )'
#try 'foo $(bar)'
@@ -106,7 +106,6 @@ main()
#try '$((1 + $foo))'
#try "foo '\`'"
#try 'foo "`"'
-#dbg=true
#try "\"'\""
-try "foo 'bar" "baz' &&"
+#try "foo 'bar" "baz' &&"
}