* Add support for declare export * Do not allow declare module inside declare module * Reallow module exports outside module * Add handling of `declare export default` Add check for multiple module.export declarations * Disallow export let/const/type Refactor parsing object properties to share more code and add support for getters and setters * Rename tests * Update test fixtures * Optimize for performance * disallow declare export interface outside of module * Refactor code to be more readable and less lookahead * Add comments * Add test for export star as * Test for number literal getter/setter * Add more tests * Fix tests * Allow union types and correctly eat semi after type * Use non computed keys * Fix tests
129 lines
2.7 KiB
JSON
129 lines
2.7 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 52,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 52
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 52,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 52
|
|
}
|
|
},
|
|
"sourceType": "module",
|
|
"body": [
|
|
{
|
|
"type": "DeclareModule",
|
|
"start": 0,
|
|
"end": 52,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 52
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 15,
|
|
"end": 16,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 15
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 16
|
|
},
|
|
"identifierName": "A"
|
|
},
|
|
"name": "A"
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"start": 17,
|
|
"end": 52,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 17
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 52
|
|
}
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "DeclareModuleExports",
|
|
"start": 19,
|
|
"end": 50,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 19
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 50
|
|
}
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TypeAnnotation",
|
|
"start": 41,
|
|
"end": 49,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 41
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 49
|
|
}
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 43,
|
|
"end": 49,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 43
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 49
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"kind": "CommonJS"
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |