-
Notifications
You must be signed in to change notification settings - Fork 9
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
parser: Prepare assignability refactor #215
Conversation
firebase-deployment: https://evy-lang--215-nz732yp9.web.app (250771d) |
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: Slight typo in first commit message "parser: Refactor combineTypes": pk/parser/type.go
But lovely other than minor nits barely worth mentioning.
🥦
} | ||
for _, input := range inputs { | ||
parser := newParser(input, testBuiltins()) | ||
_ = parser.parse() | ||
assertNoParseError(t, parser, input) | ||
|
||
assert.Equal(t, NONE_TYPE, UNTYPED_ARRAY.Sub) |
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.
The commit message says "fix whitespace", but you're removing an assertion. Was this an accident and you only meant to remove the blank line?
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.
That was on purpose, but I guess I can leave it in.
pkg/parser/type.go
Outdated
} | ||
return combinedT | ||
} | ||
|
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 nit: extra blank line at EOF. It does get removed in the next commit though, so not really a worry
Refactor combineTypes from a method on the parser to a standalone function as it makes no use of the parser. Move it to pkg/parser/type.go as it more naturally fits there.
Remove sameComposite as it is only used in one place and can be inlined as a oneliner.
Remove ILLEGAL type as it should never be exposed and handled internally.
Add missing godoc comment to Type.String(). It's a mystery why golangci-lint hasn't picked up on this earlier.
Fix whitespace of evy source code in parser tests.
f25d679
to
250771d
Compare
In yet another attempt to wrangle the complexities around assignability, shave
off a bunch of preparatory commits:
combineTypes
into itsameComposite
in favour of inlining