-
Notifications
You must be signed in to change notification settings - Fork 4
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
Automatic formatting for the seq!
macro
#71
Conversation
Automatic merging upon approval enabled. This didn't need any snapshot updates for vstd, so should be safe to release without coordinating with Verus vstd. |
Awesome, thank you for this! |
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.
Generally looks good to me. In this bit:
attr* ~ seq_str ~ bang_str ~ !"=" ~
why is the !"="
needed?
Hmm, I am not sure it is actually necessary for this spot; that sort of thing was necessary for the non-specialized macro invocations to prevent it from taking up a token tree in the case of someone did something like |
This `!"="` is necessary for general macro calls, to prevent accidentally considering `foo != bar` as if it were a macro call going `foo! =` and then getting confused. However, both the `calc` and `seq` macros explicitly check for the curly braces, so don't actually need the negative forward lookahead.
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.
Cool, thanks for looking into that.
Fairly straightforward implementation of the
seq!
macro by reusing the comma-delimited-exprs. When everything within aseq
fits on a single line, it places it on single line, otherwise each element gets its own line.CC @mmcloughlin because of #42