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
refactor: Retype ASTs #739
Conversation
Deploying with Cloudflare Pages
|
Oh... the build is failing mostly because all the parsers pass |
Codecov Report
@@ Coverage Diff @@
## main #739 +/- ##
=======================================
Coverage 68.85% 68.86%
=======================================
Files 61 61
Lines 7725 7765 +40
Branches 1454 1454
=======================================
+ Hits 5319 5347 +28
- Misses 2393 2405 +12
Partials 13 13
Continue to review full report at Codecov.
|
Description
This PR adds types to
packages/core/src/parser/ParserUtil.ts
to get rid of all warnings in that file. Doing this required a few additional changes beyond just adding types toParserUtil
:SourceRange
type intypes/ast
rangeOf
tokenEnd
to fix bugstokenEnd
and also a substantial reworking of our AST types:
SourceRange
types/ast
now providesA
andC
types to put in that generic slot, corresponding to "abstract" or "concrete"A
, because even in our compilers we generate a lot of synthetic nodesC
was madeC
, but some were forced to beA
due to aboveA
instead ofC
just for conveniencenodeType
andchildren
fields in synthetic nodes, which were fixedChecklist