Subsume json (#7985)

* Add Subsume JSON transform

https://github.com/tc39/proposal-json-superset is at stage 3.

This allows U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped inside strings and directives.

* Move to Stage 3

* Break diretive parsing

* Update README

* Handle multi-escape sequences

* Remove babylon files after rename
This commit is contained in:
Justin Ridgewell
2018-05-19 15:32:05 -04:00
committed by GitHub
parent 51eef099b3
commit 0879a6d608
34 changed files with 809 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
("beforeafter");
// ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')

View File

@@ -0,0 +1,107 @@
{
"type": "File",
"start": 0,
"end": 101,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 83
}
},
"program": {
"type": "Program",
"start": 0,
"end": 101,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 83
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 17
}
},
"expression": {
"type": "StringLiteral",
"start": 1,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 15
}
},
"extra": {
"rawValue": "beforeafter",
"raw": "\"beforeafter\"",
"parenthesized": true,
"parenStart": 0
},
"value": "beforeafter"
},
"trailingComments": [
{
"type": "CommentLine",
"value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')",
"start": 18,
"end": 101,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 83
}
}
}
]
}
],
"directives": []
},
"comments": [
{
"type": "CommentLine",
"value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')",
"start": 18,
"end": 101,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 83
}
}
}
]
}