-
Notifications
You must be signed in to change notification settings - Fork 66
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
ast: Add TypeDecl Node #5102
ast: Add TypeDecl Node #5102
Conversation
if err := a.scope.DefineConst(a.zctx, d.Name, e); err != nil { | ||
return dag.Def{}, err | ||
} | ||
return dag.Def{Name: d.Name, Expr: e}, nil |
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.
Nit: These are on multiple lines everywhere else in here.
return dag.Def{Name: d.Name, Expr: e}, nil | |
return dag.Def{ | |
Name: d.Name, | |
Expr: e | |
}, nil |
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.
For me I follow my made up rule that if a struct declaration fits below 80 characters, I do it single line. I think that seems reasonable, no?
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.
Totally reasonable. I just prefer to see changes follow the prevailing style. Just a nit though so do as you like!
3fa90aa
to
8e97d69
Compare
This commit adds a separate AST decl type for type declarations as opposed to using const deleclartions for this case. This is part of a series of changes preparing the AST code base to support position information for AST nodes.
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.
So nice I'm approving it twice.
This commit adds a separate AST decl type for type declarations as opposed to using const deleclartions for this case. This is part of a series of changes preparing the AST code base to support position information for AST nodes.