UNPKG

awv3

Version:
1,676 lines (1,675 loc) 177 kB
{ "type": "File", "start": 0, "end": 1279, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 42, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 1279, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 42, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 33, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 33 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 18, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 18 } }, "local": { "type": "Identifier", "start": 7, "end": 18, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 18 }, "identifierName": "DragHandler" }, "name": "DragHandler" } } ], "source": { "type": "StringLiteral", "start": 24, "end": 32, "loc": { "start": { "line": 1, "column": 24 }, "end": { "line": 1, "column": 32 } }, "extra": { "rawValue": "./drag", "raw": "'./drag'" }, "value": "./drag" } }, { "type": "ImportDeclaration", "start": 34, "end": 67, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 33 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 41, "end": 52, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 18 } }, "local": { "type": "Identifier", "start": 41, "end": 52, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 18 }, "identifierName": "DrawHandler" }, "name": "DrawHandler" } } ], "source": { "type": "StringLiteral", "start": 58, "end": 66, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 32 } }, "extra": { "rawValue": "./draw", "raw": "'./draw'" }, "value": "./draw" } }, { "type": "ImportDeclaration", "start": 68, "end": 103, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 35 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 75, "end": 87, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 } }, "local": { "type": "Identifier", "start": 75, "end": 87, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 }, "identifierName": "AngleHandler" }, "name": "AngleHandler" } } ], "source": { "type": "StringLiteral", "start": 93, "end": 102, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 34 } }, "extra": { "rawValue": "./angle", "raw": "'./angle'" }, "value": "./angle" } }, { "type": "ImportDeclaration", "start": 104, "end": 141, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 37 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 111, "end": 124, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 20 } }, "local": { "type": "Identifier", "start": 111, "end": 124, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 20 }, "identifierName": "FilletHandler" }, "name": "FilletHandler" } } ], "source": { "type": "StringLiteral", "start": 130, "end": 140, "loc": { "start": { "line": 4, "column": 26 }, "end": { "line": 4, "column": 36 } }, "extra": { "rawValue": "./fillet", "raw": "'./fillet'" }, "value": "./fillet" } }, { "type": "ImportDeclaration", "start": 142, "end": 185, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 43 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 149, "end": 165, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 23 } }, "local": { "type": "Identifier", "start": 149, "end": 165, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 23 }, "identifierName": "DuplicateHandler" }, "name": "DuplicateHandler" } } ], "source": { "type": "StringLiteral", "start": 171, "end": 184, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 42 } }, "extra": { "rawValue": "./duplicate", "raw": "'./duplicate'" }, "value": "./duplicate" } }, { "type": "FunctionDeclaration", "start": 187, "end": 652, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 25, "column": 1 } }, "id": { "type": "Identifier", "start": 196, "end": 211, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 24 }, "identifierName": "getHandlerClass" }, "name": "getHandlerClass" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 212, "end": 216, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 29 }, "identifierName": "name" }, "name": "name" } ], "body": { "type": "BlockStatement", "start": 218, "end": 652, "loc": { "start": { "line": 7, "column": 31 }, "end": { "line": 25, "column": 1 } }, "body": [ { "type": "SwitchStatement", "start": 224, "end": 650, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 24, "column": 5 } }, "discriminant": { "type": "Identifier", "start": 232, "end": 236, "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 16 }, "identifierName": "name" }, "name": "name" }, "cases": [ { "type": "SwitchCase", "start": 248, "end": 292, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 10, "column": 31 } }, "consequent": [ { "type": "ReturnStatement", "start": 273, "end": 292, "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 31 } }, "argument": { "type": "Identifier", "start": 280, "end": 291, "loc": { "start": { "line": 10, "column": 19 }, "end": { "line": 10, "column": 30 }, "identifierName": "DragHandler" }, "name": "DragHandler" } } ], "test": { "type": "StringLiteral", "start": 253, "end": 259, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 19 } }, "extra": { "rawValue": "drag", "raw": "'drag'" }, "value": "drag" } }, { "type": "SwitchCase", "start": 301, "end": 314, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 21 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 306, "end": 313, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 20 } }, "extra": { "rawValue": "point", "raw": "'point'" }, "value": "point" } }, { "type": "SwitchCase", "start": 323, "end": 335, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 20 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 328, "end": 334, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 19 } }, "extra": { "rawValue": "line", "raw": "'line'" }, "value": "line" } }, { "type": "SwitchCase", "start": 344, "end": 361, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 25 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 349, "end": 360, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 24 } }, "extra": { "rawValue": "arccenter", "raw": "'arccenter'" }, "value": "arccenter" } }, { "type": "SwitchCase", "start": 370, "end": 387, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 25 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 375, "end": 386, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 24 } }, "extra": { "rawValue": "arcmiddle", "raw": "'arcmiddle'" }, "value": "arcmiddle" } }, { "type": "SwitchCase", "start": 396, "end": 414, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 26 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 401, "end": 413, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 25 } }, "extra": { "rawValue": "arctangent", "raw": "'arctangent'" }, "value": "arctangent" } }, { "type": "SwitchCase", "start": 423, "end": 469, "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 17, "column": 31 } }, "consequent": [ { "type": "ReturnStatement", "start": 450, "end": 469, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 31 } }, "argument": { "type": "Identifier", "start": 457, "end": 468, "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 30 }, "identifierName": "DrawHandler" }, "name": "DrawHandler" } } ], "test": { "type": "StringLiteral", "start": 428, "end": 436, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 21 } }, "extra": { "rawValue": "circle", "raw": "'circle'" }, "value": "circle" } }, { "type": "SwitchCase", "start": 478, "end": 524, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 19, "column": 32 } }, "consequent": [ { "type": "ReturnStatement", "start": 504, "end": 524, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 19, "column": 32 } }, "argument": { "type": "Identifier", "start": 511, "end": 523, "loc": { "start": { "line": 19, "column": 19 }, "end": { "line": 19, "column": 31 }, "identifierName": "AngleHandler" }, "name": "AngleHandler" } } ], "test": { "type": "StringLiteral", "start": 483, "end": 490, "loc": { "start": { "line": 18, "column": 13 }, "end": { "line": 18, "column": 20 } }, "extra": { "rawValue": "angle", "raw": "'angle'" }, "value": "angle" } }, { "type": "SwitchCase", "start": 533, "end": 581, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 21, "column": 33 } }, "consequent": [ { "type": "ReturnStatement", "start": 560, "end": 581, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 21, "column": 33 } }, "argument": { "type": "Identifier", "start": 567, "end": 580, "loc": { "start": { "line": 21, "column": 19 }, "end": { "line": 21, "column": 32 }, "identifierName": "FilletHandler" }, "name": "FilletHandler" } } ], "test": { "type": "StringLiteral", "start": 538, "end": 546, "loc": { "start": { "line": 20, "column": 13 }, "end": { "line": 20, "column": 21 } }, "extra": { "rawValue": "fillet", "raw": "'fillet'" }, "value": "fillet" } }, { "type": "SwitchCase", "start": 590, "end": 644, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 23, "column": 36 } }, "consequent": [ { "type": "ReturnStatement", "start": 620, "end": 644, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 36 } }, "argument": { "type": "Identifier", "start": 627, "end": 643, "loc": { "start": { "line": 23, "column": 19 }, "end": { "line": 23, "column": 35 }, "identifierName": "DuplicateHandler" }, "name": "DuplicateHandler" } } ], "test": { "type": "StringLiteral", "start": 595, "end": 606, "loc": { "start": { "line": 22, "column": 13 }, "end": { "line": 22, "column": 24 } }, "extra": { "rawValue": "duplicate", "raw": "'duplicate'" }, "value": "duplicate" } } ] } ], "directives": [], "trailingComments": null }, "trailingComments": [ { "type": "CommentLine", "value": " destroy oldHandler (if needed) and return the new handler", "start": 654, "end": 714, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 27, "column": 60 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 715, "end": 1157, "loc": { "start": { "line": 28, "column": 0 }, "end": { "line": 38, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 730, "end": 1157, "loc": { "start": { "line": 28, "column": 15 }, "end": { "line": 38, "column": 1 } }, "id": { "type": "Identifier", "start": 739, "end": 746, "loc": { "start": { "line": 28, "column": 24 }, "end": { "line": 28, "column": 31 }, "identifierName": "Handler" }, "name": "Handler", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 747, "end": 755, "loc": { "start": { "line": 28, "column": 32 }, "end": { "line": 28, "column": 40 }, "identifierName": "sketcher" }, "name": "sketcher" }, { "type": "Identifier", "start": 757, "end": 761, "loc": { "start": { "line": 28, "column": 42 }, "end": { "line": 28, "column": 46 }, "identifierName": "name" }, "name": "name" }, { "type": "Identifier", "start": 763, "end": 773, "loc": { "start": { "line": 28, "column": 48 }, "end": { "line": 28, "column": 58 }, "identifierName": "oldHandler" }, "name": "oldHandler" } ], "body": { "type": "BlockStatement", "start": 775, "end": 1157, "loc": { "start": { "line": 28, "column": 60 }, "end": { "line": 38, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 781, "end": 879, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 102 } }, "declarations": [ { "type": "VariableDeclarator", "start": 787, "end": 844, "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 67 } }, "id": { "type": "Identifier", "start": 787, "end": 795, "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 18 }, "identifierName": "oldClass" }, "name": "oldClass" }, "init": { "type": "CallExpression", "start": 798, "end": 844, "loc": { "start": { "line": 29, "column": 21 }, "end": { "line": 29, "column": 67 } }, "callee": { "type": "Identifier", "start": 798, "end": 813, "loc": { "start": { "line": 29, "column": 21 }, "end": { "line": 29, "column": 36 }, "identifierName": "getHandlerClass" }, "name": "getHandlerClass" }, "arguments": [ { "type": "LogicalExpression", "start": 814, "end": 843, "loc": { "start": { "line": 29, "column": 37 }, "end": { "line": 29, "column": 66 } }, "left": { "type": "Identifier", "start": 814, "end": 824, "loc": { "start": { "line": 29, "column": 37 }, "end": { "line": 29, "column": 47 }, "identifierName": "oldHandler" }, "name": "oldHandler" }, "operator": "&&", "right": { "type": "MemberExpression", "start": 828, "end": 843, "loc": { "start": { "line": 29, "column": 51 }, "end": { "line": 29, "column": 66 } }, "object": { "type": "Identifier", "start": 828, "end": 838, "loc": { "start": { "line": 29, "column": 51 }, "end": { "line": 29, "column": 61 }, "identifierName": "oldHandler" }, "name": "oldHandler" }, "property": { "type": "Identifier", "start": 839, "end": 843, "loc": { "start": { "line": 29, "column": 62 }, "end": { "line": 29, "column": 66 }, "identifierName": "name" }, "name": "name" }, "computed": false } } ] } }, { "type": "VariableDeclarator", "start": 846, "end": 878, "loc": { "start": { "line": 29, "column": 69 }, "end": { "line": 29, "column": 101 } }, "id": { "type": "Identifier", "start": 846, "end": 854, "loc": { "start": { "line": 29, "column": 69 }, "end": { "line": 29, "column": 77 }, "identifierName": "newClass" }, "name": "newClass" }, "init": { "type": "CallExpression", "start": 857, "end": 878, "loc": { "start": { "line": 29, "column": 80 }, "end": { "line": 29, "column": 101 } }, "callee": { "type": "Identifier", "start": 857, "end": 872, "loc": { "start": { "line": 29, "column": 80 }, "end": { "line": 29, "column": 95 }, "identifierName": "getHandlerClass" }, "name": "getHandlerClass" }, "arguments": [ { "type": "Identifier", "start": 873, "end": 877, "loc": { "start": { "line": 29, "column": 96 }, "end": { "line": 29, "column": 100 }, "identifierName": "name" }, "name": "name" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 884, "end": 909, "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 29 } }, "declarations": [ { "type": "VariableDeclarator", "start": 888, "end": 908, "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 28 } }, "id": { "type": "Identifier", "start": 888, "end": 895, "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 15 }, "identifierName": "handler" }, "name": "handler" }, "init": { "type": "Identifier", "start": 898, "end": 908, "loc": { "start": { "line": 30, "column": 18 }, "end": { "line": 30, "column": 28 }, "identifierName": "oldHandler" }, "name": "oldHandler" } } ], "kind": "let" }, { "type": "IfStatement", "start": 914, "end": 1075, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 35, "column": 5 } }, "test": { "type": "BinaryExpression", "start": 918, "end": 939, "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 31, "column": 29 } }, "left": { "type": "Identifier", "start": 918, "end": 926, "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 31, "column": 16 }, "identifierName": "oldClass" }, "name": "oldClass" }, "operator": "!==", "right": { "type": "Identifier", "start": 931, "end": 939, "loc": { "start": { "line": 31, "column": 21 }, "end": { "line": 31, "column": 29 }, "identifierName": "newClass" }, "name": "newClass" } }, "consequent": { "type": "BlockStatement", "start": 941, "end": 1075, "loc": { "start": { "line": 31, "column": 31 }, "end": { "line": 35, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 951, "end": 986, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 43 } }, "expression": { "type": "LogicalExpression", "start": 951, "end": 985, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 42 } }, "left": { "type": "Identifier", "start": 951, "end": 961, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 18 }, "identifierName": "oldHandler" }, "name": "oldHandler" }, "operator": "&&", "right": { "type": "CallExpression", "start": 965, "end": 985, "loc": { "start": { "line": 32, "column": 22 }, "end": { "line": 32, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 965, "end": 983, "loc": { "start": { "line": 32, "column": 22 }, "end": { "line": 32, "column": 40 } }, "object": { "type": "Identifier", "start": 965, "end": 975, "loc": { "start": { "line": 32, "column": 22 }, "end": { "line": 32, "column": 32 }, "identifierName": "oldHandler" }, "name": "oldHandler" }, "property": { "type": "Identifier", "start": 976, "end": 983, "loc": { "start": { "line": 32, "column": 33 }, "end": { "line": 32, "column": 40 }, "identifierName": "destroy" }, "name": "destroy" }, "computed": false }, "arguments": [] } } }, { "type": "ExpressionStatement", "start": 995, "end": 1034, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 47 } }, "expression": { "type": "AssignmentExpression", "start": 995, "end": 1033, "loc": { "start": { "line": 33, "column": 8 },