Permalink
Browse files
Make the here doc translation tests more realistic.
- Loading branch information...
Showing
with
12 additions
and
7 deletions.
-
+6
−6
test/osh2oil.sh
-
+6
−1
tools/osh2oil.py
|
|
@@ -303,11 +303,11 @@ here-doc() { |
|
|
# DQ context
|
|
|
osh0-oil3 << 'OSH' 3<< 'OIL'
|
|
|
cat <<ONE
|
|
|
echo $hi
|
|
|
echo $hi ${varsub} $((1 + 2)) $(echo comsub)
|
|
|
ONE
|
|
|
OSH
|
|
|
cat << """
|
|
|
echo $hi
|
|
|
echo $hi $(varsub) $(1 + 2) $[echo comsub]
|
|
|
"""
|
|
|
OIL
|
|
|
|
|
|
@@ -325,13 +325,13 @@ OIL |
|
|
# <<- in DQ context
|
|
|
osh0-oil3 << 'OSH' 3<< 'OIL'
|
|
|
cat <<-ONE
|
|
|
indented
|
|
|
body
|
|
|
indented ${varsub} $((1 + 2))
|
|
|
body $(echo comsub)
|
|
|
ONE
|
|
|
OSH
|
|
|
cat << """
|
|
|
indented
|
|
|
body
|
|
|
indented $(varsub) $(1 + 2)
|
|
|
body $[echo comsub]
|
|
|
"""
|
|
|
OIL
|
|
|
|
|
|
|
|
|
@@ -290,7 +290,12 @@ def DoRedirect(self, node, local_symbols): |
|
|
|
|
|
#self.cursor.SkipUntil(here_begin_spid + 1)
|
|
|
|
|
|
# Now print the lines
|
|
|
# Now print the lines. TODO: Have a flag to indent these to the level of
|
|
|
# the owning command, e.g.
|
|
|
# cat <<EOF
|
|
|
# EOF
|
|
|
# Or since most here docs are the top level, you could just have a hack
|
|
|
# for a fixed indent? TODO: Look at real use cases.
|
|
|
for part in node.stdin_parts:
|
|
|
self.DoWordPart(part, local_symbols)
|
|
|
|
|
|
|
0 comments on commit
2701d38