Skip to content

Commit

Permalink
More work on self-hosted parser (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Mar 10, 2023
1 parent a78e7f1 commit d7efeb0
Show file tree
Hide file tree
Showing 7 changed files with 704 additions and 109 deletions.
19 changes: 14 additions & 5 deletions compare_compilers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@
# They should be able to tokenize and parse each Jou file in exactly the same way.
# If tokenizing/parsing a Jou file fails, both compilers should fail with the same error message.

if [ $# = 0 ]; then
fix=no
elif [ $# = 1 ] && [ "$1" = --fix ]; then
if [ "$1" = --fix ]; then
fix=yes
shift
else
echo "Usage: $0 [--fix]" >&2
fix=no
fi

if [[ "$1" =~ ^- ]]; then
echo "Usage: $0 [--fix] [FILENAME1.jou FILENAME2.jou ...]" >&2
exit 2
fi

if [ $# = 0 ]; then
files=$(find stdlib examples tests -name '*.jou' | sort)
else
files=$@
fi

if [[ "$OS" =~ Windows ]]; then
source activate
mingw32-make
Expand All @@ -32,7 +41,7 @@ else
make self_hosted_compiler
fi

for file in $(find stdlib examples tests -name '*.jou' | sort); do
for file in $files; do
for action in tokenize parse run; do
echo "$action $file"
error_list_file=self_hosted/${action}s_wrong.txt
Expand Down
Loading

0 comments on commit d7efeb0

Please sign in to comment.