-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static-promotion
: pretty printer error
#1795
Comments
Super weird thing!! I was able to reduce the test case. Here's a file that triggers the problem on a round-trip through the pretty printer:
To see the problem, run:
You will see these offending lines:
Anyway, the problem seems to come from having a If you're curious, most of the reduction work was done by Shrink Ray. Here was the original interesting test I used most of the time: #!/bin/sh -x
set -e
CALYX=/Users/fabian/cu/research/futil/target/debug/calyx
# Check that the original program parses.
$CALYX -d all $1 > /dev/null
# Apply a pass and re-parse.
outfile="$1-compiled"
$CALYX -p static-promotion -m file $1 > $outfile
# Abort here (it's uninteresting) when parsing this file *succeeds*.
! $CALYX -d all $outfile > /dev/null 2> err.txt
# This is interesting if we find the error we're looking for.
grep 'expected identifier' err.txt This test follows @anshumanmohan's advice directly (check that the original file parses, but passing it through the Along the way, Shrink Ray discovered a fascinating fact I didn't know about our parser: it doesn't require whitespace between keywords and lots of stuff! For example, this file parses:
Tired of typing the space in |
Fixes #1795, which identified a problem with the closing parentheses in `static invoke` invocations.
A bonus fix, not directly discovered in #1795 but still obviously a problem.
There seems to be a small bug in the pretty printer.
In this commit I have pushed two files.
a.futil
andb.futil
. The former was generated via the eDSL and the latter by runningThe file
b.futil
has a stray closing paren here.The text was updated successfully, but these errors were encountered: