-
Notifications
You must be signed in to change notification settings - Fork 19
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
Editorial: convert to ecmarkup #172
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.
This looks great, thanks for doing the conversion! I left some comments about small issues, LGTM other than those.
This does indeed look great! I only have small concern that we tie decoding very closely to Ecma262 language semantics. E.g. we could spec decoding of mappings as syntax directed operations over a grammar like <emu-grammar type="definition">
Mappings :
`;` Mappings
MappingList Mappings?
MappingList :
Mapping
MappingList `,` Mapping
Mapping :
GeneratedColumn
GeneratedColumn OriginalSource OriginalLine OriginalColumn
GeneratedColumn OriginalSource OriginalLine OriginalColumn Name
GeneratedColumn : Vlq
OriginalSource : Vlq
OriginalLine : Vlq
OriginalColumn : Vlq
Name : Vlq
</emu-grammar> then we wouldn't need to use We can do that as a follow-up though to get us started. |
64b72f5
to
7e2977b
Compare
8a2b273
to
d8c28be
Compare
8c22f58
to
9aa06fe
Compare
I pushed an update that still relies on ECMA-262's data types, so that we don't have to re-define them, but it only uses its basic version of objects (https://tc39.es/ecma262/#sec-object-type), without all the special behavior that JS supports on top of it. I also define a "JSON object" and "JSON array", which we can use across the specification rather than referring to ECMA-262's object (a JSON object is more restrictive, because it guarantees that it's deeply JSON-compatible). The way those utilities read properties from the object ( I also redefined string.split: we'll probably not needed it once we do Simon's grammar suggestion, but for now it avoids having to go read how string splitting works in ECMA-262. (trying to get the preview to auto-update...) |
I looked through the latest changes wrt ECMA-262 datatypes and left some comments. Otherwise the new changes LGTM. |
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.
Very nice! Thanks!
ad928aa
to
6bbb203
Compare
This PR migrates our spec from Bikeshed to Ecmarkup, trying to keep the changes between the two versions as minimal as possible (i.e. only where we use some bikeshedisms that do not work with Ecmarkup).
I still need to make GitHub pages work, but for now you can:
npm ci
node --run build
ornode --run watch
out
folder and open it in the browserThis PR unlocks possible improvement, such as @szuend's grammar-based VLQ parsing definition, but they will be done in follow-ups.
Preview: https://nicolo-ribaudo.github.io/source-map/branch/ecmarkup/