Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working on translating here docs to Oil.
- Test an invariant of the arena with here docs. - Make the here-dq.sh test pass by adding a line_span() instance for the ending delimiter. - here-sq.sh still doesn't pass. - Statically evaluate the here doc delimiter at the end of the line, rather when you encounter it. This makes it so there are fewer things in the HereDoc node. - Remove HereDoc.was_filled. Add here_end_span_id. - here-doc spec test: Clarify that multiple leading tabs are stripped. - Move some parse error bugs from cmd_parse_test.py to test/parse-errors.sh. This revealed a bug in osh -c 'cat <<EOF', which is now fixed.
- Loading branch information
Andy Chu
committed
Aug 28, 2018
1 parent
92051ae
commit 4cdba05
Showing
12 changed files
with
178 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# | ||
# Usage: | ||
# ./arena.sh <function name> | ||
|
||
set -o nounset | ||
set -o pipefail | ||
set -o errexit | ||
|
||
source test/common.sh | ||
|
||
compare() { | ||
local path=$1 | ||
|
||
mkdir -p _tmp/arena | ||
bin/osh --parse-and-print-arena $path > _tmp/arena/left.txt | ||
diff -u $path _tmp/arena/left.txt | ||
} | ||
|
||
here-doc() { | ||
compare test/arena/here-dq.sh | ||
compare test/arena/here-sq.sh | ||
} | ||
|
||
readonly -a PASSING=( | ||
here-doc | ||
) | ||
|
||
all-passing() { | ||
run-all "${PASSING[@]}" | ||
} | ||
|
||
run-for-release() { | ||
local out_dir=_tmp/arena | ||
mkdir -p $out_dir | ||
|
||
all-passing | tee $out_dir/log.txt | ||
|
||
echo "Wrote $out_dir/log.txt" | ||
} | ||
|
||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
echo "DQ" | ||
|
||
cat <<EOF | ||
here | ||
doc $var | ||
EOF | ||
echo -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
echo 'SQ' | ||
|
||
cat <<'EOF' | ||
here | ||
doc $var | ||
EOF | ||
echo -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.