UNPKG

awv3

Version:
1,613 lines (1,612 loc) 952 kB
{ "type": "Program", "start": 0, "end": 9259, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 231, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 48, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 48 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "name": "Constraint" } } ], "importKind": "value", "source": { "type": "Literal", "start": 23, "end": 47, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 47 } }, "value": "../sketcher/constraint", "rawValue": "../sketcher/constraint", "raw": "'../sketcher/constraint'" } }, { "type": "ImportDeclaration", "start": 50, "end": 90, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 40 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 57, "end": 63, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "local": { "type": "Identifier", "start": 57, "end": 63, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "name": "Sketch" } } ], "importKind": "value", "source": { "type": "Literal", "start": 69, "end": 89, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 39 } }, "value": "../sketcher/sketch", "rawValue": "../sketcher/sketch", "raw": "'../sketcher/sketch'" } }, { "type": "ImportDeclaration", "start": 92, "end": 161, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 69 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 100, "end": 115, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 23 } }, "imported": { "type": "Identifier", "start": 100, "end": 115, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 23 } }, "name": "GeometricObject" }, "local": { "type": "Identifier", "start": 100, "end": 115, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 23 } }, "name": "GeometricObject" } }, { "type": "ImportSpecifier", "start": 117, "end": 122, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 30 } }, "imported": { "type": "Identifier", "start": 117, "end": 122, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 30 } }, "name": "Point" }, "local": { "type": "Identifier", "start": 117, "end": 122, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 30 } }, "name": "Point" } }, { "type": "ImportSpecifier", "start": 124, "end": 128, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 36 } }, "imported": { "type": "Identifier", "start": 124, "end": 128, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 36 } }, "name": "Line" }, "local": { "type": "Identifier", "start": 124, "end": 128, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 36 } }, "name": "Line" } } ], "importKind": "value", "source": { "type": "Literal", "start": 135, "end": 160, "loc": { "start": { "line": 3, "column": 43 }, "end": { "line": 3, "column": 68 } }, "value": "../sketcher/geomobjects", "rawValue": "../sketcher/geomobjects", "raw": "'../sketcher/geomobjects'" } }, { "type": "ImportDeclaration", "start": 163, "end": 189, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 170, "end": 175, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "local": { "type": "Identifier", "start": 170, "end": 175, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 181, "end": 188, "loc": { "start": { "line": 4, "column": 18 }, "end": { "line": 4, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" }, "trailingComments": [ { "type": "CommentLine", "value": "====================== Disjoint Set Union ========================", "start": 193, "end": 261, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 68 } }, "range": [ 193, 261 ] } ] }, { "type": "ExportNamedDeclaration", "start": 263, "end": 1201, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 48, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 270, "end": 1201, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 48, "column": 1 } }, "id": { "type": "Identifier", "start": 276, "end": 279, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 16 } }, "name": "DSU", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 280, "end": 1201, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 48, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 287, "end": 344, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 10, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 287, "end": 298, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 15 } }, "name": "constructor" }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 298, "end": 344, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 10, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 301, "end": 344, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 10, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 312, "end": 337, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 33 } }, "expression": { "type": "AssignmentExpression", "start": 312, "end": 336, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 32 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 312, "end": 324, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 20 } }, "object": { "type": "ThisExpression", "start": 312, "end": 316, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 12 } } }, "property": { "type": "Identifier", "start": 317, "end": 324, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 20 } }, "name": "parents" }, "computed": false }, "right": { "type": "NewExpression", "start": 327, "end": 336, "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 32 } }, "callee": { "type": "Identifier", "start": 331, "end": 334, "loc": { "start": { "line": 9, "column": 27 }, "end": { "line": 9, "column": 30 } }, "name": "Map" }, "arguments": [] } } } ] } } }, { "type": "MethodDefinition", "start": 352, "end": 421, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 14, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 352, "end": 361, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 13 } }, "name": "getParent" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 361, "end": 421, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 14, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 362, "end": 365, "loc": { "start": { "line": 12, "column": 14 }, "end": { "line": 12, "column": 17 } }, "name": "obj" } ], "body": { "type": "BlockStatement", "start": 367, "end": 421, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 14, "column": 5 } }, "body": [ { "type": "ReturnStatement", "start": 378, "end": 414, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 44 } }, "argument": { "type": "LogicalExpression", "start": 385, "end": 413, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 43 } }, "left": { "type": "CallExpression", "start": 385, "end": 406, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 36 } }, "callee": { "type": "MemberExpression", "start": 385, "end": 401, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 31 } }, "object": { "type": "MemberExpression", "start": 385, "end": 397, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 27 } }, "object": { "type": "ThisExpression", "start": 385, "end": 389, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 19 } } }, "property": { "type": "Identifier", "start": 390, "end": 397, "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 27 } }, "name": "parents" }, "computed": false }, "property": { "type": "Identifier", "start": 398, "end": 401, "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 13, "column": 31 } }, "name": "get" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 402, "end": 405, "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 35 } }, "name": "obj" } ] }, "operator": "||", "right": { "type": "Identifier", "start": 410, "end": 413, "loc": { "start": { "line": 13, "column": 40 }, "end": { "line": 13, "column": 43 } }, "name": "obj" } } } ] } } }, { "type": "MethodDefinition", "start": 429, "end": 494, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 18, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 429, "end": 438, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 13 } }, "name": "setParent" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 438, "end": 494, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 18, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 439, "end": 442, "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 17 } }, "name": "obj" }, { "type": "Identifier", "start": 444, "end": 447, "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 16, "column": 22 } }, "name": "par" } ], "body": { "type": "BlockStatement", "start": 449, "end": 494, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 18, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 460, "end": 487, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 35 } }, "expression": { "type": "CallExpression", "start": 460, "end": 486, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 34 } }, "callee": { "type": "MemberExpression", "start": 460, "end": 476, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 24 } }, "object": { "type": "MemberExpression", "start": 460, "end": 472, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 20 } }, "object": { "type": "ThisExpression", "start": 460, "end": 464, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 12 } } }, "property": { "type": "Identifier", "start": 465, "end": 472, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 20 } }, "name": "parents" }, "computed": false }, "property": { "type": "Identifier", "start": 473, "end": 476, "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 24 } }, "name": "set" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 477, "end": 480, "loc": { "start": { "line": 17, "column": 25 }, "end": { "line": 17, "column": 28 } }, "name": "obj" }, { "type": "Identifier", "start": 482, "end": 485, "loc": { "start": { "line": 17, "column": 30 }, "end": { "line": 17, "column": 33 } }, "name": "par" } ] } } ] } } }, { "type": "MethodDefinition", "start": 502, "end": 599, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 23, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 502, "end": 507, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 9 } }, "name": "touch" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 507, "end": 599, "loc": { "start": { "line": 20, "column": 9 }, "end": { "line": 23, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 508, "end": 511, "loc": { "start": { "line": 20, "column": 10 }, "end": { "line": 20, "column": 13 } }, "name": "obj" } ], "body": { "type": "BlockStatement", "start": 513, "end": 599, "loc": { "start": { "line": 20, "column": 15 }, "end": { "line": 23, "column": 5 } }, "body": [ { "type": "IfStatement", "start": 524, "end": 592, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 22, "column": 39 } }, "test": { "type": "UnaryExpression", "start": 528, "end": 550, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 21, "column": 34 } }, "operator": "!", "prefix": true, "argument": { "type": "CallExpression", "start": 529, "end": 550, "loc": { "start": { "line": 21, "column": 13 }, "end": { "line": 21, "column": 34 } }, "callee": { "type": "MemberExpression", "start": 529, "end": 545, "loc": { "start": { "line": 21, "column": 13 }, "end": { "line": 21, "column": 29 } }, "object": { "type": "MemberExpression", "start": 529, "end": 541, "loc": { "start": { "line": 21, "column": 13 }, "end": { "line": 21, "column": 25 } }, "object": { "type": "ThisExpression", "start": 529, "end": 533, "loc": { "start": { "line": 21, "column": 13 }, "end": { "line": 21, "column": 17 } } }, "property": { "type": "Identifier", "start": 534, "end": 541, "loc": { "start": { "line": 21, "column": 18 }, "end": { "line": 21, "column": 25 } }, "name": "parents" }, "computed": false }, "property": { "type": "Identifier", "start": 542, "end": 545, "loc": { "start": { "line": 21, "column": 26 }, "end": { "line": 21, "column": 29 } }, "name": "has" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 546, "end": 549, "loc": { "start": { "line": 21, "column": 30 }, "end": { "line": 21, "column": 33 } }, "name": "obj" } ] } }, "consequent": { "type": "ExpressionStatement", "start": 565, "end": 592, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 39 } }, "expression": { "type": "CallExpression", "start": 565, "end": 591, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 38 } }, "callee": { "type": "MemberExpression", "start": 565, "end": 581, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 28 } }, "object": { "type": "MemberExpression", "start": 565, "end": 577, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 24 } }, "object": { "type": "ThisExpression", "start": 565, "end": 569, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 16 } } }, "property": { "type": "Identifier", "start": 570, "end": 577, "loc": { "start": { "line": 22, "column": 17 }, "end": { "line": 22, "column": 24 } }, "name": "parents" }, "computed": false }, "property": { "type": "Identifier", "start": 578, "end": 581, "loc": { "start": { "line": 22, "column": 25 }, "end": { "line": 22, "column": 28 } }, "name": "set" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 582, "end": 585, "loc": { "start": { "line": 22, "column": 29 }, "end": { "line": 22, "column": 32 } }, "name": "obj" }, { "type": "Identifier", "start": 587, "end": 590, "loc": { "start": { "line": 22, "column": 34 }, "end": { "line": 22, "column": 37 } }, "name": "obj" } ] } }, "alternate": null } ] } } }, { "type": "MethodDefinition", "start": 607, "end": 816, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 32, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 607, "end": 614, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 11 } }, "name": "getHead" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 614, "end": 816, "loc": { "start": { "line": 25, "column": 11 }, "end": { "line": 32, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 615, "end": 618, "loc": { "start": { "line": 25, "column": 12 }, "end": { "line": 25, "column": 15 } }, "name": "obj" } ], "body": { "type": "BlockStatement", "start": 620, "end": 816, "loc": { "start": { "line": 25, "column": 17 }, "end": { "line": 32, "column": 5 } }, "body": [