-
Notifications
You must be signed in to change notification settings - Fork 653
Extract Evaluator
and NameResolver
out of checker
#229
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
Conversation
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 this move makes a lot of sense.
(I second Jake's suggestion of moving IsNumericLiteralName to jsnum.)
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.
Marking as needing changes at least until CI is rerun to pick up main.
} | ||
} | ||
|
||
func (r *NameResolver) ResolveEntityName(name *ast.Node, meaning ast.SymbolFlags, ignoreErrors bool, dontResolveAlias bool, location *ast.Node) *ast.Symbol { |
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.
Just skimming this again; this is something that isn't present on the NameResolver in the old compiler; is there some difference here that makes this something that should move? I see it referenced in the constant evaluator, but the evaluator in the old compiler doesn't seem to require it.
(More or less, it seems like there's more moving than we previously had which I'm trying to understand)
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.
As I mentioned in the PR description, I'm extracting related functionality that enum
emit depends on from the checker, resolveEntityName
is used by resolveEntity
, which is critical to the constant evaluator. Rather than duplicate resolveEntity
in the checker and the enum transform, I opted to extract resolveEntity
out of checker and centralize it within the new ConstantEvaluator
type.
I've opted to do that in this PR instead of the enum
emit PR to make both PRs easier to reason over.
Closing in favor of the more limited |
To better support enum emit without relying on the type checker, this moves
NameResolver
and related functionality from thecompiler
package to thebinder
package, and extractsEvaluator
and related functionality into a newevaluator
package.