-
Notifications
You must be signed in to change notification settings - Fork 18
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
Operator print tweak for schedule display #690
Conversation
val = node.val | ||
if Base.isoperator(Symbol(val)) | ||
Symbol(val) | ||
else | ||
val | ||
end |
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.
I think we could just always return Symbol(val)
anyway - I see that it's no-op for functions:
julia> :(1 << $(Symbol(map)) >>= 1)
:(1 << map >>= 1)
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.
I'm not sure this is always true. Different functions in different modules can have the same name.
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
In the case of +, ideally we would return +=. However, if we must use the <<>> notation, this is helpful. i will merge this now, and feel free to file a PR to get it to use the incrementing assignments if you would like. There is a list of them in FinchNotation/syntax.jl |
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.
Thanks for the fix!
Hi @willow-ahrens,
I noticed that schedule printing gives an incorrect syntax for an operator located between operators.
gives:
When this output is pasted to the interpreter (as it's just julia code) it complains that the syntax is invalid:
With this fix the result is:
And it can be copied and reused directly. WDYT?