This PR begins the process of incrementally implementing many of the improvements in the error recovery branch.
I'm going to start with the easy stuff and work my way up to more complicated parts of the implementation, and in that spirit, this PR has two changes:
Streamline the AppendVM by using private fields and an optional debug field pattern. This simplifies the implementation and also makes it possible to consolidate InternalAppendVM into the normal VM. The benefit of the "opcode-only" subset of the VM was waning anyway, and most of the remaining distinction had to do with private implementation details that are no longer present in the VM interface because they're now implemented using private fields.
Replace const enum and enum with normal constants and literal types. There was a good reason for us to use const enum when we originally made the decision. But the dynamics have changed. Between (a) the fact that we can't reliably that const enum will be compiled away anymore, and (b) the fact that TS now has literal types, using normal constants and literal types is a better choice.
This PR begins the process of incrementally implementing many of the improvements in the error recovery branch.
I'm going to start with the easy stuff and work my way up to more complicated parts of the implementation, and in that spirit, this PR has two changes:
debug
field pattern. This simplifies the implementation and also makes it possible to consolidateInternalAppendVM
into the normalVM
. The benefit of the "opcode-only" subset of the VM was waning anyway, and most of the remaining distinction had to do with private implementation details that are no longer present in theVM
interface because they're now implemented using private fields.const enum
andenum
with normal constants and literal types. There was a good reason for us to useconst enum
when we originally made the decision. But the dynamics have changed. Between (a) the fact that we can't reliably thatconst enum
will be compiled away anymore, and (b) the fact that TS now has literal types, using normal constants and literal types is a better choice.