UNPKG

awv3

Version:
1,716 lines (1,715 loc) 188 kB
{ "type": "File", "start": 0, "end": 1376, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 45, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 1376, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 45, "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": "ImportDeclaration", "start": 186, "end": 219, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 33 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 193, "end": 204, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 18 } }, "local": { "type": "Identifier", "start": 193, "end": 204, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 18 }, "identifierName": "TrimHandler" }, "name": "TrimHandler" } } ], "source": { "type": "StringLiteral", "start": 210, "end": 218, "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 32 } }, "extra": { "rawValue": "./trim", "raw": "'./trim'" }, "value": "./trim" } }, { "type": "FunctionDeclaration", "start": 221, "end": 739, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 28, "column": 1 } }, "id": { "type": "Identifier", "start": 230, "end": 245, "loc": { "start": { "line": 8, "column": 9 }, "end": { "line": 8, "column": 24 }, "identifierName": "getHandlerClass" }, "name": "getHandlerClass" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 246, "end": 250, "loc": { "start": { "line": 8, "column": 25 }, "end": { "line": 8, "column": 29 }, "identifierName": "name" }, "name": "name" } ], "body": { "type": "BlockStatement", "start": 252, "end": 739, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 28, "column": 1 } }, "body": [ { "type": "SwitchStatement", "start": 258, "end": 737, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 27, "column": 5 } }, "discriminant": { "type": "Identifier", "start": 266, "end": 270, "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 16 }, "identifierName": "name" }, "name": "name" }, "cases": [ { "type": "SwitchCase", "start": 282, "end": 326, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 11, "column": 31 } }, "consequent": [ { "type": "ReturnStatement", "start": 307, "end": 326, "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 31 } }, "argument": { "type": "Identifier", "start": 314, "end": 325, "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 30 }, "identifierName": "DragHandler" }, "name": "DragHandler" } } ], "test": { "type": "StringLiteral", "start": 287, "end": 293, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 19 } }, "extra": { "rawValue": "drag", "raw": "'drag'" }, "value": "drag" } }, { "type": "SwitchCase", "start": 335, "end": 348, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 21 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 340, "end": 347, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 20 } }, "extra": { "rawValue": "point", "raw": "'point'" }, "value": "point" } }, { "type": "SwitchCase", "start": 357, "end": 369, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 20 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 362, "end": 368, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 19 } }, "extra": { "rawValue": "line", "raw": "'line'" }, "value": "line" } }, { "type": "SwitchCase", "start": 378, "end": 395, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 25 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 383, "end": 394, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 24 } }, "extra": { "rawValue": "arccenter", "raw": "'arccenter'" }, "value": "arccenter" } }, { "type": "SwitchCase", "start": 404, "end": 421, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 25 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 409, "end": 420, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 24 } }, "extra": { "rawValue": "arcmiddle", "raw": "'arcmiddle'" }, "value": "arcmiddle" } }, { "type": "SwitchCase", "start": 430, "end": 448, "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 26 } }, "consequent": [], "test": { "type": "StringLiteral", "start": 435, "end": 447, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 25 } }, "extra": { "rawValue": "arctangent", "raw": "'arctangent'" }, "value": "arctangent" } }, { "type": "SwitchCase", "start": 457, "end": 503, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 18, "column": 31 } }, "consequent": [ { "type": "ReturnStatement", "start": 484, "end": 503, "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 31 } }, "argument": { "type": "Identifier", "start": 491, "end": 502, "loc": { "start": { "line": 18, "column": 19 }, "end": { "line": 18, "column": 30 }, "identifierName": "DrawHandler" }, "name": "DrawHandler" } } ], "test": { "type": "StringLiteral", "start": 462, "end": 470, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 21 } }, "extra": { "rawValue": "circle", "raw": "'circle'" }, "value": "circle" } }, { "type": "SwitchCase", "start": 512, "end": 558, "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 20, "column": 32 } }, "consequent": [ { "type": "ReturnStatement", "start": 538, "end": 558, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 32 } }, "argument": { "type": "Identifier", "start": 545, "end": 557, "loc": { "start": { "line": 20, "column": 19 }, "end": { "line": 20, "column": 31 }, "identifierName": "AngleHandler" }, "name": "AngleHandler" } } ], "test": { "type": "StringLiteral", "start": 517, "end": 524, "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 20 } }, "extra": { "rawValue": "angle", "raw": "'angle'" }, "value": "angle" } }, { "type": "SwitchCase", "start": 567, "end": 615, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 22, "column": 33 } }, "consequent": [ { "type": "ReturnStatement", "start": 594, "end": 615, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 33 } }, "argument": { "type": "Identifier", "start": 601, "end": 614, "loc": { "start": { "line": 22, "column": 19 }, "end": { "line": 22, "column": 32 }, "identifierName": "FilletHandler" }, "name": "FilletHandler" } } ], "test": { "type": "StringLiteral", "start": 572, "end": 580, "loc": { "start": { "line": 21, "column": 13 }, "end": { "line": 21, "column": 21 } }, "extra": { "rawValue": "fillet", "raw": "'fillet'" }, "value": "fillet" } }, { "type": "SwitchCase", "start": 624, "end": 678, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 24, "column": 36 } }, "consequent": [ { "type": "ReturnStatement", "start": 654, "end": 678, "loc": { "start": { "line": 24, "column": 12 }, "end": { "line": 24, "column": 36 } }, "argument": { "type": "Identifier", "start": 661, "end": 677, "loc": { "start": { "line": 24, "column": 19 }, "end": { "line": 24, "column": 35 }, "identifierName": "DuplicateHandler" }, "name": "DuplicateHandler" } } ], "test": { "type": "StringLiteral", "start": 629, "end": 640, "loc": { "start": { "line": 23, "column": 13 }, "end": { "line": 23, "column": 24 } }, "extra": { "rawValue": "duplicate", "raw": "'duplicate'" }, "value": "duplicate" } }, { "type": "SwitchCase", "start": 687, "end": 731, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 26, "column": 31 } }, "consequent": [ { "type": "ReturnStatement", "start": 712, "end": 731, "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 31 } }, "argument": { "type": "Identifier", "start": 719, "end": 730, "loc": { "start": { "line": 26, "column": 19 }, "end": { "line": 26, "column": 30 }, "identifierName": "TrimHandler" }, "name": "TrimHandler" } } ], "test": { "type": "StringLiteral", "start": 692, "end": 698, "loc": { "start": { "line": 25, "column": 13 }, "end": { "line": 25, "column": 19 } }, "extra": { "rawValue": "trim", "raw": "'trim'" }, "value": "trim" } } ] } ], "directives": [], "trailingComments": null }, "trailingComments": [ { "type": "CommentLine", "value": " destroy oldHandler (if needed) and return the new handler", "start": 741, "end": 801, "loc": { "start": { "line": 30, "column": 0 }, "end": { "line": 30, "column": 60 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 802, "end": 1244, "loc": { "start": { "line": 31, "column": 0 }, "end": { "line": 41, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 817, "end": 1244, "loc": { "start": { "line": 31, "column": 15 }, "end": { "line": 41, "column": 1 } }, "id": { "type": "Identifier", "start": 826, "end": 833, "loc": { "start": { "line": 31, "column": 24 }, "end": { "line": 31, "column": 31 }, "identifierName": "Handler" }, "name": "Handler", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 834, "end": 842, "loc": { "start": { "line": 31, "column": 32 }, "end": { "line": 31, "column": 40 }, "identifierName": "sketcher" }, "name": "sketcher" }, { "type": "Identifier", "start": 844, "end": 848, "loc": { "start": { "line": 31, "column": 42 }, "end": { "line": 31, "column": 46 }, "identifierName": "name" }, "name": "name" }, { "type": "Identifier", "start": 850, "end": 860, "loc": { "start": { "line": 31, "column": 48 }, "end": { "line": 31, "column": 58 }, "identifierName": "oldHandler" }, "name": "oldHandler" } ], "body": { "type": "BlockStatement", "start": 862, "end": 1244, "loc": { "start": { "line": 31, "column": 60 }, "end": { "line": 41, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 868, "end": 966, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 32, "column": 102 } }, "declarations": [ { "type": "VariableDeclarator", "start": 874, "end": 931, "loc": { "start": { "line": 32, "column": 10 }, "end": { "line": 32, "column": 67 } }, "id": { "type": "Identifier", "start": 874, "end": 882, "loc": { "start": { "line": 32, "column": 10 }, "end": { "line": 32, "column": 18 }, "identifierName": "oldClass" }, "name": "oldClass" }, "init": { "type": "CallExpression", "start": 885, "end": 931, "loc": { "start": { "line": 32, "column": 21 }, "end": { "line": 32, "column": 67 } }, "callee": { "type": "Identifier", "start": 885, "end": 900, "loc": { "start": { "line": 32, "column": 21 }, "end": { "line": 32, "column": 36 }, "identifierName": "getHandlerClass" }, "name": "getHandlerClass" }, "arguments": [ { "type": "LogicalExpression", "start": 901, "end": 930, "loc": { "start": { "line": 32, "column": 37 }, "end": { "line": 32, "column": 66 } }, "left": { "type": "Identifier", "start": 901, "end": 911, "loc": { "start": { "line": 32, "column": 37 }, "end": { "line": 32, "column": 47 }, "identifierName": "oldHandler" }, "name": "oldHandler" }, "operator": "&&", "right": { "type": "MemberExpression", "start": 915, "end": 930, "loc": { "start": { "line": 32, "column": 51 }, "end": { "line": 32, "column": 66 } }, "object": { "type": "Identifier", "start": 915, "end": 925, "loc": { "start": { "line": 32, "column": 51 }, "end": { "line": 32, "column": 61 }, "identifierName": "oldHandler" }, "name": "oldHandler" }, "property": { "type": "Identifier", "start": 926, "end": 930, "loc": { "start": { "line": 32, "column": 62 }, "end": { "line": 32, "column": 66 }, "identifierName": "name" }, "name": "name" }, "computed": false } } ] } }, { "type": "VariableDeclarator", "start": 933, "end": 965, "loc": { "start": { "line": 32, "column": 69 }, "end": { "line": 32, "column": 101 } }, "id": { "type": "Identifier", "start": 933, "end": 941, "loc": { "start": { "line": 32, "column": 69 }, "end": { "line": 32, "column": 77 }, "identifierName": "newClass" }, "name": "newClass" }, "init": { "type": "CallExpression", "start": 944, "end": 965, "loc": { "start": { "line": 32, "column": 80 }, "end": { "line": 32, "column": 101 } }, "callee": { "type": "Identifier", "start": 944, "end": 959, "loc": { "start": { "line": 32, "column": 80 }, "end": { "line": 32, "column": 95 }, "identifierName": "getHandlerClass" }, "name": "getHandlerClass" }, "arguments": [ { "type": "Identifier", "start": 960, "end": 964, "loc": { "start": { "line": 32, "column": 96 }, "end": { "line": 32, "column": 100 }, "identifierName": "name" }, "name": "name" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 971, "end": 996, "loc": { "start": { "line": 33, "column": 4 }, "end": { "line": 33, "column": 29 } }, "declarations": [ { "type": "VariableDeclarator", "start": 975, "end": 995, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 28 } }, "id": { "type": "Identifier", "start": 975, "end": 982, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 15 }, "identifierName": "handler" }, "name": "handler" }, "init": { "type": "Identifier", "start": 985, "end": 995, "loc": { "start": { "line": 33, "column": 18 }, "end": { "line": 33, "column": 28 }, "identifierName": "oldHandler" }, "name": "oldHandler" } } ], "kind": "let" }, { "type": "IfStatement", "start": 1001, "end": 1162, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 38, "column": 5 } }, "test": { "type": "BinaryExpression", "start": 1005, "end": 1026, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 29 } }, "left": { "type": "Identifier", "start": 1005, "end": 1013, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 16 }, "identifierName": "oldClass" }, "name": "oldClass" }, "operator": "!==", "right": { "type": "Identifier", "start": 1018, "end": 1026, "loc": { "start": { "line": 34, "column": 21 }, "end": { "line": 34, "column": 29 }, "identifierName": "newClass" }, "name": "newClass" } }, "consequent": { "type": "BlockStatement", "start": 1028, "end": 1162, "loc": { "start": { "line": 34, "column": 31 }, "end": { "line": 38, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 1038, "end": 1073, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 43 } }, "expression": { "type": "LogicalExpression", "start": 1038, "end": 1072, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 42 } }, "left": { "type": "Identifier", "start": 1038, "end": 1048, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35,