-
Notifications
You must be signed in to change notification settings - Fork 2
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
implement func name(...) {....}
as short for name=func(...) {...}
#92
Conversation
handlElse
-> printElse
handlElse
-> printElse
handlElse
-> printElse
func name(...) {....}
as short for name=func(...) {...}
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 side remarks,otherwise 👍
name := &ast.Identifier{} | ||
name.Token = p.curToken | ||
lit.Name = name |
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's a bit difficult to read
Maybe this
name := &ast.Identifier{} | |
name.Token = p.curToken | |
lit.Name = name | |
lit.Name = &ast.Identifier{Token: p.curToken} |
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.
But the rest of the code might be aligned with current code.
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's like that because the Tokens are in Base... so you'd need to do the super annoying {Base: Base{Token: ...
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.
Oh indeed
} | ||
|
||
// Common part of Inspect and SetCacheKey. Outputs the rest of the function. | ||
func (f *Function) finishFuncOutput(out *strings.Builder) string { |
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 bit out of this PR, but maybe you could use godoc link
func (f *Function) finishFuncOutput(out *strings.Builder) string { | |
// Common part of [Inspect] and [SetCacheKey]. Prints the rest of the function. |
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 unsure about the godoc link in such case
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.
godoc doesn't generate doc for private function does it? or maybe there is an option to do so I suppose
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.
Good point
func name(...
as alternative toname = func(...
#44handlElse
->printElse
/ corrects Allow else if #91