UNPKG

awv3

Version:
1,604 lines 630 kB
{ "type": "File", "start": 0, "end": 3289, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 94, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 3289, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 94, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 73, "end": 104, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 31 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 80, "end": 90, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 17 } }, "local": { "type": "Identifier", "start": 85, "end": 90, "loc": { "start": { "line": 2, "column": 12 }, "end": { "line": 2, "column": 17 }, "identifierName": "THREE" }, "name": "THREE", "leadingComments": null }, "leadingComments": null } ], "source": { "type": "StringLiteral", "start": 96, "end": 103, "loc": { "start": { "line": 2, "column": 23 }, "end": { "line": 2, "column": 30 } }, "extra": { "rawValue": "three", "raw": "'three'" }, "value": "three" }, "leadingComments": [ { "type": "CommentLine", "value": " lowlevel commands are those that map 1-to-1 to ClassCad constructions", "start": 0, "end": 72, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 72 } } } ] }, { "type": "ImportDeclaration", "start": 105, "end": 142, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 37 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 112, "end": 121, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 } }, "local": { "type": "Identifier", "start": 112, "end": 121, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 }, "identifierName": "Ccfuturef" }, "name": "Ccfuturef" } } ], "source": { "type": "StringLiteral", "start": 127, "end": 141, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 36 } }, "extra": { "rawValue": "../ccfuturef", "raw": "'../ccfuturef'" }, "value": "../ccfuturef" } }, { "type": "ImportDeclaration", "start": 143, "end": 172, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 29 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 150, "end": 155, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "local": { "type": "Identifier", "start": 150, "end": 155, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 }, "identifierName": "Ccref" }, "name": "Ccref" } } ], "source": { "type": "StringLiteral", "start": 161, "end": 171, "loc": { "start": { "line": 4, "column": 18 }, "end": { "line": 4, "column": 28 } }, "extra": { "rawValue": "../ccref", "raw": "'../ccref'" }, "value": "../ccref" } }, { "type": "ImportDeclaration", "start": 173, "end": 202, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 29 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 180, "end": 188, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 15 } }, "local": { "type": "Identifier", "start": 185, "end": 188, "loc": { "start": { "line": 5, "column": 12 }, "end": { "line": 5, "column": 15 }, "identifierName": "ast" }, "name": "ast" } } ], "source": { "type": "StringLiteral", "start": 194, "end": 201, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 28 } }, "extra": { "rawValue": "./ast", "raw": "'./ast'" }, "value": "./ast" } }, { "type": "FunctionDeclaration", "start": 204, "end": 921, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 26, "column": 1 } }, "id": { "type": "Identifier", "start": 213, "end": 218, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 14 }, "identifierName": "toAst" }, "name": "toAst" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 219, "end": 220, "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 7, "column": 16 }, "identifierName": "x" }, "name": "x" } ], "body": { "type": "BlockStatement", "start": 222, "end": 921, "loc": { "start": { "line": 7, "column": 18 }, "end": { "line": 26, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 228, "end": 266, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 42 } }, "test": { "type": "BinaryExpression", "start": 232, "end": 242, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 18 } }, "left": { "type": "Identifier", "start": 232, "end": 233, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 9 }, "identifierName": "x" }, "name": "x" }, "operator": "===", "right": { "type": "NullLiteral", "start": 238, "end": 242, "loc": { "start": { "line": 8, "column": 14 }, "end": { "line": 8, "column": 18 } } } }, "consequent": { "type": "ReturnStatement", "start": 244, "end": 266, "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 42 } }, "argument": { "type": "NewExpression", "start": 251, "end": 265, "loc": { "start": { "line": 8, "column": 27 }, "end": { "line": 8, "column": 41 } }, "callee": { "type": "MemberExpression", "start": 255, "end": 263, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 39 } }, "object": { "type": "Identifier", "start": 255, "end": 258, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 34 }, "identifierName": "ast" }, "name": "ast" }, "property": { "type": "Identifier", "start": 259, "end": 263, "loc": { "start": { "line": 8, "column": 35 }, "end": { "line": 8, "column": 39 }, "identifierName": "Pass" }, "name": "Pass" }, "computed": false }, "arguments": [] } }, "alternate": null }, { "type": "SwitchStatement", "start": 271, "end": 506, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 17, "column": 5 } }, "discriminant": { "type": "UnaryExpression", "start": 279, "end": 287, "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 20 } }, "operator": "typeof", "prefix": true, "argument": { "type": "Identifier", "start": 286, "end": 287, "loc": { "start": { "line": 9, "column": 19 }, "end": { "line": 9, "column": 20 }, "identifierName": "x" }, "name": "x" }, "extra": { "parenthesizedArgument": false } }, "cases": [ { "type": "SwitchCase", "start": 299, "end": 316, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 25 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 304, "end": 315, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 24 } }, "extra": { "rawValue": "undefined", "raw": "'undefined'" }, "value": "undefined" } }, { "type": "SwitchCase", "start": 325, "end": 384, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 12, "column": 43 } }, "consequent": [ { "type": "ReturnStatement", "start": 353, "end": 384, "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 43 } }, "argument": { "type": "NewExpression", "start": 360, "end": 383, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 12, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 364, "end": 380, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 39 } }, "object": { "type": "Identifier", "start": 364, "end": 367, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 26 }, "identifierName": "ast" }, "name": "ast" }, "property": { "type": "Identifier", "start": 368, "end": 380, "loc": { "start": { "line": 12, "column": 27 }, "end": { "line": 12, "column": 39 }, "identifierName": "NameConstant" }, "name": "NameConstant" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 381, "end": 382, "loc": { "start": { "line": 12, "column": 40 }, "end": { "line": 12, "column": 41 }, "identifierName": "x" }, "name": "x" } ] } } ], "test": { "type": "StringLiteral", "start": 330, "end": 339, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 22 } }, "extra": { "rawValue": "boolean", "raw": "'boolean'" }, "value": "boolean" } }, { "type": "SwitchCase", "start": 393, "end": 442, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 14, "column": 34 } }, "consequent": [ { "type": "ReturnStatement", "start": 420, "end": 442, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 34 } }, "argument": { "type": "NewExpression", "start": 427, "end": 441, "loc": { "start": { "line": 14, "column": 19 }, "end": { "line": 14, "column": 33 } }, "callee": { "type": "MemberExpression", "start": 431, "end": 438, "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 30 } }, "object": { "type": "Identifier", "start": 431, "end": 434, "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 26 }, "identifierName": "ast" }, "name": "ast" }, "property": { "type": "Identifier", "start": 435, "end": 438, "loc": { "start": { "line": 14, "column": 27 }, "end": { "line": 14, "column": 30 }, "identifierName": "Num" }, "name": "Num" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 439, "end": 440, "loc": { "start": { "line": 14, "column": 31 }, "end": { "line": 14, "column": 32 }, "identifierName": "x" }, "name": "x" } ] } } ], "test": { "type": "StringLiteral", "start": 398, "end": 406, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 21 } }, "extra": { "rawValue": "number", "raw": "'number'" }, "value": "number" } }, { "type": "SwitchCase", "start": 451, "end": 500, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 16, "column": 34 } }, "consequent": [ { "type": "ReturnStatement", "start": 478, "end": 500, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 34 } }, "argument": { "type": "NewExpression", "start": 485, "end": 499, "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 16, "column": 33 } }, "callee": { "type": "MemberExpression", "start": 489, "end": 496, "loc": { "start": { "line": 16, "column": 23 }, "end": { "line": 16, "column": 30 } }, "object": { "type": "Identifier", "start": 489, "end": 492, "loc": { "start": { "line": 16, "column": 23 }, "end": { "line": 16, "column": 26 }, "identifierName": "ast" }, "name": "ast" }, "property": { "type": "Identifier", "start": 493, "end": 496, "loc": { "start": { "line": 16, "column": 27 }, "end": { "line": 16, "column": 30 }, "identifierName": "Str" }, "name": "Str" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 497, "end": 498, "loc": { "start": { "line": 16, "column": 31 }, "end": { "line": 16, "column": 32 }, "identifierName": "x" }, "name": "x" } ] } } ], "test": { "type": "StringLiteral", "start": 456, "end": 464, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 21 } }, "extra": { "rawValue": "string", "raw": "'string'" }, "value": "string" } } ] }, { "type": "IfStatement", "start": 511, "end": 813, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 22, "column": 44 } }, "test": { "type": "BinaryExpression", "start": 515, "end": 533, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 26 } }, "left": { "type": "Identifier", "start": 515, "end": 516, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 9 }, "identifierName": "x" }, "name": "x" }, "operator": "instanceof", "right": { "type": "Identifier", "start": 528, "end": 533, "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 18, "column": 26 }, "identifierName": "Array" }, "name": "Array" } }, "consequent": { "type": "ReturnStatement", "start": 535, "end": 569, "loc": { "start": { "line": 18, "column": 28 }, "end": { "line": 18, "column": 62 } }, "argument": { "type": "NewExpression", "start": 542, "end": 568, "loc": { "start": { "line": 18, "column": 35 }, "end": { "line": 18, "column": 61 } }, "callee": { "type": "MemberExpression", "start": 546, "end": 554, "loc": { "start": { "line": 18, "column": 39 }, "end": { "line": 18, "column": 47 } }, "object": { "type": "Identifier", "start": 546, "end": 549, "loc": { "start": { "line": 18, "column": 39 }, "end": { "line": 18, "column": 42 }, "identifierName": "ast" }, "name": "ast" }, "property": { "type": "Identifier", "start": 550, "end": 554, "loc": { "start": { "line": 18, "column": 43 }, "end": { "line": 18, "column": 47 }, "identifierName": "List" }, "name": "List" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 555, "end": 567, "loc": { "start": { "line": 18, "column": 48 }, "end": { "line": 18, "column": 60 } }, "callee": { "type": "MemberExpression", "start": 555, "end": 560, "loc": { "start": { "line": 18, "column": 48 }, "end": { "line": 18, "column": 53 } }, "object": { "type": "Identifier", "start": 555, "end": 556, "loc": { "start": { "line": 18, "column": 48 }, "end": { "line": 18, "column": 49 }, "identifierName": "x" }, "name": "x" }, "property": { "type": "Identifier", "start": 557, "end": 560, "loc": { "start": { "line": 18, "column": 50 }, "end": { "line": 18, "column": 53 }, "identifierName": "map" }, "name": "map" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 561, "end": 566, "loc": { "start": { "line": 18, "column": 54 }, "end": { "line": 18, "column": 59 }, "identifierName": "toAst" }, "name": "toAst" } ] } ] } }, "alternate": { "type": "IfStatement", "start": 579, "end": 813, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 22, "column": 44 } }, "test": { "type": "BinaryExpression", "start": 583, "end": 609, "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 39 } }, "left": { "type": "Identifier", "start": 583, "end": 584, "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 14 }, "identifierName": "x" }, "name": "x" }, "operator": "instanceof", "right": { "type": "MemberExpression", "start": 596, "end": 609, "loc": { "start": { "line": 19, "column": 26 }, "end": { "line": 19, "column": 39 } }, "object": { "type": "Identifier", "start": 596, "end": 601, "loc": { "start": { "line": 19, "column": 26 }, "end": { "line": 19, "column": 31 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 602, "end": 609, "loc": { "start": { "line": 19, "column": 32 }, "end": { "line": 19, "column": 39 }, "identifierName": "Vector3" }, "name": "Vector3" }, "computed": false } }, "consequent": { "type": "ReturnStatement", "start": 611, "end": 657, "loc": { "start": { "line": 19, "column": 41 }, "end": { "line": 19, "column": 87 } }, "argument": { "type": "NewExpression", "start": 618, "end": 656, "loc": { "start": { "line": 19, "column": 48 }, "end": { "line": 19, "column": 86 } }, "callee": { "type": "MemberExpression", "start": 622, "end": 632, "loc": { "start": { "line": 19, "column": 52 }, "end": { "line": 19, "column": 62 } }, "object": { "type": "Identifier", "start": 622, "end": 625, "loc": { "start": { "line": 19, "column": 52 }, "end": { "line": 19, "column": 55 }, "identifierName": "ast" }, "name": "ast" }, "property": { "type": "Identifier", "start": 626, "end": 632, "loc": { "start": { "line": 19, "column": 56 }, "end": { "line": 19, "column": 62 }, "identifierName": "Vector" }, "name": "Vector" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 633, "end": 655, "loc": { "start": { "line": 19, "column": 63 }, "end": { "line": 19, "column": 85 } }, "callee": { "type": "MemberExpression", "start": 633, "end": 648, "loc": { "start": { "line": 19, "column": 63 }, "end": { "line": 19, "column": 78 } }, "object": { "type": "CallExpression", "start": 633, "end": 644, "loc": { "start": { "line": 19, "column": 63 }, "end": { "line": 19, "column": 74 } }, "callee": { "type": "MemberExpression", "start": 633, "end": 642, "loc": { "start": { "line": 19, "column": 63 }, "end": { "line": 19, "column": 72 } }, "object": { "type": "Identifier", "start": 633, "end": 634, "loc": { "start": { "line": 19, "column": 63 }, "end": { "line": 19, "column": 64 }, "identifierName": "x" }, "name": "x" }, "property": { "type": "Identifier", "start": 635, "end": 642, "loc": { "start": { "line": 19, "column": 65 }, "end": { "line": 19, "column": 72 }, "identifierName": "toArray" }, "name": "toArray" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 645, "end": 648, "loc": { "start": { "line": 19, "column": 75 }, "end": { "line": 19, "column": 78 }, "identifierName": "map" }, "name": "map" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 649, "end": 654, "loc": { "start": { "line": 19, "column": 79 }, "end": { "line": 19, "column": 84 }, "identifierName": "toAst" }, "name": "toAst" } ] } ] } }, "alternate": { "type": "IfStatement", "start": 667, "end": 813, "loc": { "start": { "line": 20, "column": 9 }, "end": { "line": 22, "column": 44 } }, "test": { "type": "BinaryExpression", "start": 671, "end": 689, "loc": { "start": { "line": 20, "column": 13 }, "end": { "line