* Flow enums parsing * Parse exporting enums * Enums parsing remove lookahead, other improvements * Enums: add EnumBody and EnumMember aliases, change boolean members to use BooleaLiteral value * Fix enum member init flow type, now that boolean members have a BooleanLiteral value * Flow enums: use contextual utils, change members length checks to use logic operators, remove reserved word logic modification * Flow enums: remove unnecessary code in generator, fix error message
117 lines
2.3 KiB
JSON
117 lines
2.3 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 14,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 1
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 14,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 1
|
|
}
|
|
},
|
|
"sourceType": "script",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "EnumDeclaration",
|
|
"start": 0,
|
|
"end": 14,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 1
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 5,
|
|
"end": 6,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 5
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 6
|
|
},
|
|
"identifierName": "E"
|
|
},
|
|
"name": "E"
|
|
},
|
|
"body": {
|
|
"type": "EnumStringBody",
|
|
"start": 11,
|
|
"end": 12,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 3
|
|
}
|
|
},
|
|
"explicitType": false,
|
|
"members": [
|
|
{
|
|
"type": "EnumDefaultedMember",
|
|
"start": 11,
|
|
"end": 12,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 3
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 11,
|
|
"end": 12,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 3
|
|
},
|
|
"identifierName": "A"
|
|
},
|
|
"name": "A"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |