-
Notifications
You must be signed in to change notification settings - Fork 124
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
Parens and "Unexpected end of layout block" #81
Comments
Confirmed that this doesn't only occur in the interpreter, but also if you have such expressions in files. It only seems to arise with Added a test case for this in 17ee75e. |
The layout processor didn't account for layout blocks that were terminated by parens or braces, so this accounts for that in the context stack that is kept by the layout processor. |
@elliottt Changeset 3487737 broke one of the regression tests, involving AES.cry. The parser now does the wrong thing if the first token after
|
The fix for #81 ignored a case where a layout block was started by ParenL symbol. In that case, the layout level wouldn't be pushed on the stack, and a parse error would eventually result. This adds the check into the ParenL special case, starting an explicit block terminated by a ParenR, as well as a new virtual layout block. Also missing from the original patch was the full offsides check, which must be repeated in the ParenL special case. I think that we should probably do some refactoring of the layout processor, as I doubt that this is the only case that will produce this behavior. Additionally, the BraceL/BraceR cases were removed, as explicitly delimited layout is not currently supported.
I've fixed the AES regression, but there was another test ( |
Accidentally didn't commit some additional changes. This is the other half of 56028ec.
@elliottt Everything looks good to me now: no failed regressions, and back down to 4 failing issue tests. In particular, |
It would be nice to be able to parenthesize valid cryptol statements in the interpreter. For example, the following statements give errors
(x where x = 1) + 1
and(f where f x = x+1) 10
The text was updated successfully, but these errors were encountered: