UNPKG

awv3

Version:
1,598 lines (1,597 loc) 928 kB
{ "type": "Program", "start": 0, "end": 8865, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 224, "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": 49, "end": 89, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 40 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 56, "end": 62, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "local": { "type": "Identifier", "start": 56, "end": 62, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 13 } }, "name": "Sketch" } } ], "importKind": "value", "source": { "type": "Literal", "start": 68, "end": 88, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 39 } }, "value": "../sketcher/sketch", "rawValue": "../sketcher/sketch", "raw": "'../sketcher/sketch'" } }, { "type": "ImportDeclaration", "start": 90, "end": 159, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 69 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 98, "end": 113, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 23 } }, "imported": { "type": "Identifier", "start": 98, "end": 113, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 23 } }, "name": "GeometricObject" }, "local": { "type": "Identifier", "start": 98, "end": 113, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 23 } }, "name": "GeometricObject" } }, { "type": "ImportSpecifier", "start": 115, "end": 120, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 30 } }, "imported": { "type": "Identifier", "start": 115, "end": 120, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 30 } }, "name": "Point" }, "local": { "type": "Identifier", "start": 115, "end": 120, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 30 } }, "name": "Point" } }, { "type": "ImportSpecifier", "start": 122, "end": 126, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 36 } }, "imported": { "type": "Identifier", "start": 122, "end": 126, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 36 } }, "name": "Line" }, "local": { "type": "Identifier", "start": 122, "end": 126, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 36 } }, "name": "Line" } } ], "importKind": "value", "source": { "type": "Literal", "start": 133, "end": 158, "loc": { "start": { "line": 3, "column": 43 }, "end": { "line": 3, "column": 68 } }, "value": "../sketcher/geomobjects", "rawValue": "../sketcher/geomobjects", "raw": "'../sketcher/geomobjects'" } }, { "type": "ImportDeclaration", "start": 160, "end": 186, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 167, "end": 172, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "local": { "type": "Identifier", "start": 167, "end": 172, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 178, "end": 185, "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": 188, "end": 256, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 68 } }, "range": [ 188, 256 ] } ] }, { "type": "ExportNamedDeclaration", "start": 257, "end": 990, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 41, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 264, "end": 990, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 41, "column": 1 } }, "id": { "type": "Identifier", "start": 270, "end": 273, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 16 } }, "name": "DSU", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 274, "end": 990, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 41, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 280, "end": 335, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 10, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 280, "end": 291, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 15 } }, "name": "constructor" }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 291, "end": 335, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 10, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 294, "end": 335, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 10, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 304, "end": 329, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 33 } }, "expression": { "type": "AssignmentExpression", "start": 304, "end": 328, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 32 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 304, "end": 316, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 20 } }, "object": { "type": "ThisExpression", "start": 304, "end": 308, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 12 } } }, "property": { "type": "Identifier", "start": 309, "end": 316, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 20 } }, "name": "parents" }, "computed": false }, "right": { "type": "NewExpression", "start": 319, "end": 328, "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 32 } }, "callee": { "type": "Identifier", "start": 323, "end": 326, "loc": { "start": { "line": 9, "column": 27 }, "end": { "line": 9, "column": 30 } }, "name": "Map" }, "arguments": [] } } } ] } } }, { "type": "MethodDefinition", "start": 341, "end": 408, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 14, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 341, "end": 350, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 13 } }, "name": "getParent" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 350, "end": 408, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 14, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 351, "end": 354, "loc": { "start": { "line": 12, "column": 14 }, "end": { "line": 12, "column": 17 } }, "name": "obj" } ], "body": { "type": "BlockStatement", "start": 356, "end": 408, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 14, "column": 5 } }, "body": [ { "type": "ReturnStatement", "start": 366, "end": 402, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 44 } }, "argument": { "type": "LogicalExpression", "start": 373, "end": 401, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 43 } }, "left": { "type": "CallExpression", "start": 373, "end": 394, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 36 } }, "callee": { "type": "MemberExpression", "start": 373, "end": 389, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 31 } }, "object": { "type": "MemberExpression", "start": 373, "end": 385, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 27 } }, "object": { "type": "ThisExpression", "start": 373, "end": 377, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 19 } } }, "property": { "type": "Identifier", "start": 378, "end": 385, "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 27 } }, "name": "parents" }, "computed": false }, "property": { "type": "Identifier", "start": 386, "end": 389, "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 13, "column": 31 } }, "name": "get" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 390, "end": 393, "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 35 } }, "name": "obj" } ] }, "operator": "||", "right": { "type": "Identifier", "start": 398, "end": 401, "loc": { "start": { "line": 13, "column": 40 }, "end": { "line": 13, "column": 43 } }, "name": "obj" } } } ] } } }, { "type": "MethodDefinition", "start": 414, "end": 477, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 18, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 414, "end": 423, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 13 } }, "name": "setParent" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 423, "end": 477, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 18, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 424, "end": 427, "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 17 } }, "name": "obj" }, { "type": "Identifier", "start": 429, "end": 432, "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 16, "column": 22 } }, "name": "par" } ], "body": { "type": "BlockStatement", "start": 434, "end": 477, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 18, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 444, "end": 471, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 35 } }, "expression": { "type": "CallExpression", "start": 444, "end": 470, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 34 } }, "callee": { "type": "MemberExpression", "start": 444, "end": 460, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 24 } }, "object": { "type": "MemberExpression", "start": 444, "end": 456, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 20 } }, "object": { "type": "ThisExpression", "start": 444, "end": 448, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 12 } } }, "property": { "type": "Identifier", "start": 449, "end": 456, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 20 } }, "name": "parents" }, "computed": false }, "property": { "type": "Identifier", "start": 457, "end": 460, "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 24 } }, "name": "set" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 461, "end": 464, "loc": { "start": { "line": 17, "column": 25 }, "end": { "line": 17, "column": 28 } }, "name": "obj" }, { "type": "Identifier", "start": 466, "end": 469, "loc": { "start": { "line": 17, "column": 30 }, "end": { "line": 17, "column": 33 } }, "name": "par" } ] } } ] } } }, { "type": "MethodDefinition", "start": 483, "end": 685, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 27, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 483, "end": 490, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 11 } }, "name": "getHead" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 490, "end": 685, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 27, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 491, "end": 494, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 15 } }, "name": "obj" } ], "body": { "type": "BlockStatement", "start": 496, "end": 685, "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 27, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 506, "end": 536, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 38 } }, "declarations": [ { "type": "VariableDeclarator", "start": 510, "end": 535, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 21, "column": 37 } }, "id": { "type": "Identifier", "start": 510, "end": 513, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 21, "column": 15 } }, "name": "par" }, "init": { "type": "CallExpression", "start": 516, "end": 535, "loc": { "start": { "line": 21, "column": 18 }, "end": { "line": 21, "column": 37 } }, "callee": { "type": "MemberExpression", "start": 516, "end": 530, "loc": { "start": { "line": 21, "column": 18 }, "end": { "line": 21, "column": 32 } }, "object": { "type": "ThisExpression", "start": 516, "end": 520, "loc": { "start": { "line": 21, "column": 18 }, "end": { "line": 21, "column": 22 } } }, "property": { "type": "Identifier", "start": 521, "end": 530, "loc": { "start": { "line": 21, "column": 23 }, "end": { "line": 21, "column": 32 } }, "name": "getParent" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 531, "end": 534, "loc": { "start": { "line": 21, "column": 33 }, "end": { "line": 21, "column": 36 } }, "name": "obj" } ] } } ], "kind": "var" }, { "type": "IfStatement", "start": 545, "end": 585, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 23, "column": 23 } }, "test": { "type": "BinaryExpression", "start": 549, "end": 560, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 23 } }, "left": { "type": "Identifier", "start": 549, "end": 552, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 15 } }, "name": "par" }, "operator": "===", "right": { "type": "Identifier", "start": 557, "end": 560, "loc": { "start": { "line": 22, "column": 20 }, "end": { "line": 22, "column": 23 } }, "name": "obj" } }, "consequent": { "type": "ReturnStatement", "start": 574, "end": 585, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 23 } }, "argument": { "type": "Identifier", "start": 581, "end": 584, "loc": { "start": { "line": 23, "column": 19 }, "end": { "line": 23, "column": 22 } }, "name": "obj" } }, "alternate": null }, { "type": "VariableDeclaration", "start": 594, "end": 623, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 37 } }, "declarations": [ { "type": "VariableDeclarator", "start": 598, "end": 622, "loc": { "start": { "line": 24, "column": 12 }, "end": { "line": 24, "column": 36 } }, "id": { "type": "Identifier", "start": 598, "end": 602, "loc": { "start": { "line": 24, "column": 12 }, "end": { "line": 24, "column": 16 } }, "name": "head" }, "init": { "type": "CallExpression", "start": 605, "end": 622, "loc": { "start": { "line": 24, "column": 19 }, "end": { "line": 24, "column": 36 } }, "callee": { "type": "MemberExpression", "start": 605, "end": 617, "loc": { "start": { "line": 24, "column": 19 }, "end": { "line": 24, "column": 31 } }, "object": { "type": "ThisExpression", "start": 605, "end": 609, "loc": { "start": { "line": 24, "column": 19 }, "end": { "line": 24, "column": 23 } } }, "property": { "type": "Identifier", "start": 610, "end": 617, "loc": { "start": { "line": 24, "column": 24 }, "end": { "line": 24, "column": 31 } }, "name": "getHead" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 618, "end": 621, "loc": { "start": { "line": 24, "column": 32 }, "end": { "line": 24, "column": 35 } }, "name": "par" } ] } } ], "kind": "var" }, { "type": "ExpressionStatement", "start": 632, "end": 658, "loc": { "start": { "line": 25, "column": 8