Skip to content
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

Make {: one token instead of two for annotations #360

Merged
merged 3 commits into from
Aug 22, 2019

Conversation

samuelgruetter
Copy link
Collaborator

While working on Exceptions, I was surprised that in annotations, {: is two tokens.

At some point, this created a problem because in order to distinguish between set display {1, 2, 3} and {:myAnnotation}, a lookahead was needed. However, I changed the parser again, so it's not a problem any more and I believe I could implement Exceptions without making {: one token.

But still, I think making {: one token would simplify things, so I'm making this PR.

Note that strictly speaking, this is a breaking change: Previously, { :myAttribute} was accepted, but now it isn't any more, and you have to remove the space. But the whole test suite passes, so I think it's ok to enforce a consistent style of not allowing a space between { and :.

This allows us to get rid of many `IF(IsAttribute())` manual
disambiguations.

Note that IsExistentialGuard needed to be updated to look for
lbracecolon instead of lbrace followed by colon.

Also note that strictly speaking, this is a breaking change:
Previously, `{ :myAttribute}` was accepted, but now it isn't any
more, and you have to remove the space.
But the whole test suite passes, so I think it's ok to enforce
a consistent style of not allowing a space between `{` and `:`.
@RustanLeino
Copy link
Collaborator

Nice!

@RustanLeino RustanLeino merged commit fb441df into dafny-lang:master Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants