tc39 / ecmarkup

An HTML superset/Markdown subset source format for ECMAScript and related specifications
https://tc39.es/ecmarkup/
MIT License
222 stars 63 forks source link

Refactor typechecker #612

Closed bakkot closed 2 months ago

bakkot commented 2 months ago

Based on https://github.com/tc39/ecmarkup/pull/611.

No functional changes except for the error messages in some cases. Commits can be reviewed individually, if you really want to, but it's not interesting other than the "split completion types in typechecker" commit, which splits the "completion" type into normal and abrupt. They can be union'd like any other types to represent "either a normal completion or an abrupt completion", instead of needing to keep track of it as a kind of ad-hoc union.

We don't refine "abrupt" because there's no point but it would be easy to do from here if it becomes necessary.