-
Notifications
You must be signed in to change notification settings - Fork 28
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
Range #551
Range #551
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just identified minor stuff rn. I will take a more thorough look tomorrow. Why is genparser.sh
part of the changeset?
I think it is because I added execute permissions to it to run it and git captured that too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few smaller comments. I did not check the desugaring thoroughly, but just that it does not break existing stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit hard for me to follow the Desugarer, as it seems very long and repetitive. Is there a way we can nicely refactor this into smaller, easy to grok methods?
src/main/scala/viper/gobra/frontend/info/base/SymbolTable.scala
Outdated
Show resolved
Hide resolved
underlyingType(exprType(exp)) match { | ||
case _: SliceT | _: ArrayT => IntT(config.typeBounds.Int) | ||
case MapT(key, _) => SetT(key) | ||
case t => violation(s"type $t is not supported for range") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a repeated pattern, maybe we could abstract this in a method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge it by me
Range for slices/arrays is reworked as discussed.
Range for maps is also implemented.
Variables declared with := in range expressions can be shared now (this is the case with Go)