swc/ecmascript/parser/tests/jsx/basic/custom/unary/input.js.json

889 lines
27 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 266,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 15,
"column": 19
}
}
},
"body": [
{
"type": "ImportDeclaration",
"span": {
"start": 0,
"end": 26,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"span": {
"start": 7,
"end": 12,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
}
},
"local": {
"type": "Identifier",
"span": {
"start": 7,
"end": 12,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
}
},
"value": "React",
"typeAnnotation": null,
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 18,
"end": 26,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 26
}
}
},
"value": "react",
"hasEscape": false
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 39,
"end": 42,
"ctxt": 0,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 12
}
}
},
"value": "App",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 30,
"end": 243,
"ctxt": 0,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 13,
"column": 1
}
}
},
"body": {
"type": "BlockStatement",
"span": {
"start": 45,
"end": 243,
"ctxt": 0,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 13,
"column": 1
}
}
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 50,
"end": 73,
"ctxt": 0,
"loc": {
"start": {
"line": 4,
"column": 2
},
"end": {
"line": 4,
"column": 25
}
}
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 56,
"end": 72,
"ctxt": 0,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 24
}
}
},
"id": {
"type": "Identifier",
"span": {
"start": 56,
"end": 65,
"ctxt": 0,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 17
}
}
},
"value": "isLoading",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "BooleanLiteral",
"span": {
"start": 68,
"end": 72,
"ctxt": 0,
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 4,
"column": 24
}
}
},
"value": true
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 77,
"end": 240,
"ctxt": 0,
"loc": {
"start": {
"line": 5,
"column": 2
},
"end": {
"line": 12,
"column": 4
}
}
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 84,
"end": 239,
"ctxt": 0,
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 12,
"column": 3
}
}
},
"expression": {
"type": "JSXElement",
"span": {
"start": 91,
"end": 234,
"ctxt": 0,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 11,
"column": 10
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 92,
"end": 95,
"ctxt": 0,
"loc": {
"start": {
"line": 6,
"column": 5
},
"end": {
"line": 6,
"column": 8
}
}
},
"value": "div",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 92,
"end": 96,
"ctxt": 0,
"loc": {
"start": {
"line": 6,
"column": 5
},
"end": {
"line": 6,
"column": 9
}
}
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 96,
"end": 104,
"ctxt": 0,
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 7,
"column": 6
}
}
},
"value": "\n\r\n ",
"raw": "\n\r\n "
},
{
"type": "JSXElement",
"span": {
"start": 104,
"end": 119,
"ctxt": 0,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 21
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 105,
"end": 107,
"ctxt": 0,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 9
}
}
},
"value": "h1",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 105,
"end": 108,
"ctxt": 0,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 10
}
}
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 108,
"end": 114,
"ctxt": 0,
"loc": {
"start": {
"line": 7,
"column": 10
},
"end": {
"line": 7,
"column": 16
}
}
},
"value": "works ",
"raw": "works "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 116,
"end": 119,
"ctxt": 0,
"loc": {
"start": {
"line": 7,
"column": 18
},
"end": {
"line": 7,
"column": 21
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 116,
"end": 118,
"ctxt": 0,
"loc": {
"start": {
"line": 7,
"column": 18
},
"end": {
"line": 7,
"column": 20
}
}
},
"value": "h1",
"typeAnnotation": null,
"optional": false
}
}
},
{
"type": "JSXText",
"span": {
"start": 119,
"end": 127,
"ctxt": 0,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 8,
"column": 6
}
}
},
"value": "\n\r\n ",
"raw": "\n\r\n "
},
{
"type": "JSXExpressionContainer",
"expression": {
"type": "ConditionalExpression",
"span": {
"start": 138,
"end": 213,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 83
}
}
},
"test": {
"type": "Identifier",
"span": {
"start": 138,
"end": 147,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 17
}
}
},
"value": "isLoading",
"typeAnnotation": null,
"optional": false
},
"consequent": {
"type": "JSXElement",
"span": {
"start": 150,
"end": 169,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 20
},
"end": {
"line": 9,
"column": 39
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 151,
"end": 154,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 24
}
}
},
"value": "div",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 151,
"end": 155,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 25
}
}
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 155,
"end": 163,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 25
},
"end": {
"line": 9,
"column": 33
}
}
},
"value": "loading ",
"raw": "loading "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 165,
"end": 169,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 35
},
"end": {
"line": 9,
"column": 39
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 165,
"end": 168,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 35
},
"end": {
"line": 9,
"column": 38
}
}
},
"value": "div",
"typeAnnotation": null,
"optional": false
}
}
},
"alternate": {
"type": "JSXElement",
"span": {
"start": 172,
"end": 213,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 42
},
"end": {
"line": 9,
"column": 83
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 173,
"end": 176,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 43
},
"end": {
"line": 9,
"column": 46
}
}
},
"value": "div",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 173,
"end": 177,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 43
},
"end": {
"line": 9,
"column": 47
}
}
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 177,
"end": 207,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 47
},
"end": {
"line": 9,
"column": 77
}
}
},
"value": "naaaaaaaaaaaaffffffffffffffff ",
"raw": "naaaaaaaaaaaaffffffffffffffff "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 209,
"end": 213,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 79
},
"end": {
"line": 9,
"column": 83
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 209,
"end": 212,
"ctxt": 0,
"loc": {
"start": {
"line": 9,
"column": 79
},
"end": {
"line": 9,
"column": 82
}
}
},
"value": "div",
"typeAnnotation": null,
"optional": false
}
}
}
}
},
{
"type": "JSXText",
"span": {
"start": 222,
"end": 228,
"ctxt": 0,
"loc": {
"start": {
"line": 10,
"column": 7
},
"end": {
"line": 11,
"column": 4
}
}
},
"value": "\n\r\n ",
"raw": "\n\r\n "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 230,
"end": 234,
"ctxt": 0,
"loc": {
"start": {
"line": 11,
"column": 6
},
"end": {
"line": 11,
"column": 10
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 230,
"end": 233,
"ctxt": 0,
"loc": {
"start": {
"line": 11,
"column": 6
},
"end": {
"line": 11,
"column": 9
}
}
},
"value": "div",
"typeAnnotation": null,
"optional": false
}
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExportDefaultExpression",
"span": {
"start": 247,
"end": 266,
"ctxt": 0,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 15,
"column": 19
}
}
},
"expression": {
"type": "Identifier",
"span": {
"start": 262,
"end": 265,
"ctxt": 0,
"loc": {
"start": {
"line": 15,
"column": 15
},
"end": {
"line": 15,
"column": 18
}
}
},
"value": "App",
"typeAnnotation": null,
"optional": false
}
}
],
"interpreter": null
}