UNPKG

awv3

Version:
1,865 lines 12.4 MB
{ "type": "File", "start": 0, "end": 60518, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1496, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 60518, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1496, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 26, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "local": { "type": "Identifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 }, "identifierName": "delay" }, "name": "delay" } } ], "source": { "type": "StringLiteral", "start": 18, "end": 25, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 25 } }, "extra": { "rawValue": "delay", "raw": "'delay'" }, "value": "delay" } }, { "type": "ImportDeclaration", "start": 28, "end": 81, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 53 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 35, "end": 47, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 } }, "local": { "type": "Identifier", "start": 35, "end": 47, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 }, "identifierName": "editDistance" }, "name": "editDistance" } } ], "source": { "type": "StringLiteral", "start": 53, "end": 80, "loc": { "start": { "line": 2, "column": 25 }, "end": { "line": 2, "column": 52 } }, "extra": { "rawValue": "levenshtein-edit-distance", "raw": "'levenshtein-edit-distance'" }, "value": "levenshtein-edit-distance" } }, { "type": "ImportDeclaration", "start": 83, "end": 114, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 31 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 90, "end": 100, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 17 } }, "local": { "type": "Identifier", "start": 95, "end": 100, "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 17 }, "identifierName": "THREE" }, "name": "THREE" } } ], "source": { "type": "StringLiteral", "start": 106, "end": 113, "loc": { "start": { "line": 3, "column": 23 }, "end": { "line": 3, "column": 30 } }, "extra": { "rawValue": "three", "raw": "'three'" }, "value": "three" } }, { "type": "ImportDeclaration", "start": 116, "end": 159, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 43 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 123, "end": 131, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 } }, "local": { "type": "Identifier", "start": 123, "end": 131, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 }, "identifierName": "Object3D" }, "name": "Object3D" } } ], "source": { "type": "StringLiteral", "start": 137, "end": 158, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 42 } }, "extra": { "rawValue": "../../three/object3", "raw": "'../../three/object3'" }, "value": "../../three/object3" } }, { "type": "ImportDeclaration", "start": 161, "end": 201, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 40 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 168, "end": 174, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 13 } }, "local": { "type": "Identifier", "start": 168, "end": 174, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 13 }, "identifierName": "Sketch" }, "name": "Sketch" } } ], "source": { "type": "StringLiteral", "start": 180, "end": 200, "loc": { "start": { "line": 5, "column": 19 }, "end": { "line": 5, "column": 39 } }, "extra": { "rawValue": "../sketcher/sketch", "raw": "'../sketcher/sketch'" }, "value": "../sketcher/sketch" } }, { "type": "ImportDeclaration", "start": 203, "end": 238, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 35 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 210, "end": 218, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 15 } }, "local": { "type": "Identifier", "start": 210, "end": 218, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 15 }, "identifierName": "Sketcher" }, "name": "Sketcher" } } ], "source": { "type": "StringLiteral", "start": 224, "end": 237, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 34 } }, "extra": { "rawValue": "../sketcher", "raw": "'../sketcher'" }, "value": "../sketcher" } }, { "type": "ImportDeclaration", "start": 240, "end": 294, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 54 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 247, "end": 263, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 23 } }, "local": { "type": "Identifier", "start": 247, "end": 263, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 23 }, "identifierName": "SketchConstraint" }, "name": "SketchConstraint" } } ], "source": { "type": "StringLiteral", "start": 269, "end": 293, "loc": { "start": { "line": 7, "column": 29 }, "end": { "line": 7, "column": 53 } }, "extra": { "rawValue": "../sketcher/constraint", "raw": "'../sketcher/constraint'" }, "value": "../sketcher/constraint" } }, { "type": "ImportDeclaration", "start": 296, "end": 349, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 53 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 303, "end": 314, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 18 } }, "local": { "type": "Identifier", "start": 303, "end": 314, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 18 }, "identifierName": "SketchPoint" }, "name": "SketchPoint" } } ], "source": { "type": "StringLiteral", "start": 320, "end": 348, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 52 } }, "extra": { "rawValue": "../sketcher/graphics/point", "raw": "'../sketcher/graphics/point'" }, "value": "../sketcher/graphics/point" } }, { "type": "ImportDeclaration", "start": 351, "end": 402, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 51 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 358, "end": 368, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 17 } }, "local": { "type": "Identifier", "start": 358, "end": 368, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 17 }, "identifierName": "SketchLine" }, "name": "SketchLine" } } ], "source": { "type": "StringLiteral", "start": 374, "end": 401, "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 50 } }, "extra": { "rawValue": "../sketcher/graphics/line", "raw": "'../sketcher/graphics/line'" }, "value": "../sketcher/graphics/line" } }, { "type": "ImportDeclaration", "start": 404, "end": 453, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 49 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 411, "end": 420, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 16 } }, "local": { "type": "Identifier", "start": 411, "end": 420, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 16 }, "identifierName": "SketchArc" }, "name": "SketchArc" } } ], "source": { "type": "StringLiteral", "start": 426, "end": 452, "loc": { "start": { "line": 10, "column": 22 }, "end": { "line": 10, "column": 48 } }, "extra": { "rawValue": "../sketcher/graphics/arc", "raw": "'../sketcher/graphics/arc'" }, "value": "../sketcher/graphics/arc" } }, { "type": "ImportDeclaration", "start": 455, "end": 503, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 48 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 464, "end": 467, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 12 } }, "imported": { "type": "Identifier", "start": 464, "end": 467, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 12 }, "identifierName": "DSU" }, "name": "DSU" }, "local": { "type": "Identifier", "start": 464, "end": 467, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 12 }, "identifierName": "DSU" }, "name": "DSU" } } ], "source": { "type": "StringLiteral", "start": 475, "end": 502, "loc": { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 47 } }, "extra": { "rawValue": "../sketcher/constraintgen", "raw": "'../sketcher/constraintgen'" }, "value": "../sketcher/constraintgen" } }, { "type": "FunctionDeclaration", "start": 507, "end": 768, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 18, "column": 1 } }, "id": { "type": "Identifier", "start": 516, "end": 521, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 14 }, "identifierName": "check" }, "name": "check" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 522, "end": 526, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 19 }, "identifierName": "cond" }, "name": "cond" }, { "type": "Identifier", "start": 528, "end": 535, "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 28 }, "identifierName": "message" }, "name": "message" } ], "body": { "type": "BlockStatement", "start": 537, "end": 768, "loc": { "start": { "line": 13, "column": 30 }, "end": { "line": 18, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 729, "end": 765, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 40 } }, "test": { "type": "UnaryExpression", "start": 733, "end": 738, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 13 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 734, "end": 738, "loc": { "start": { "line": 17, "column": 9 }, "end": { "line": 17, "column": 13 }, "identifierName": "cond" }, "name": "cond", "leadingComments": null }, "extra": { "parenthesizedArgument": false }, "leadingComments": null }, "consequent": { "type": "ThrowStatement", "start": 740, "end": 765, "loc": { "start": { "line": 17, "column": 15 }, "end": { "line": 17, "column": 40 } }, "argument": { "type": "NewExpression", "start": 746, "end": 764, "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 39 } }, "callee": { "type": "Identifier", "start": 750, "end": 755, "loc": { "start": { "line": 17, "column": 25 }, "end": { "line": 17, "column": 30 }, "identifierName": "Error" }, "name": "Error" }, "arguments": [ { "type": "Identifier", "start": 756, "end": 763, "loc": { "start": { "line": 17, "column": 31 }, "end": { "line": 17, "column": 38 }, "identifierName": "message" }, "name": "message" } ] } }, "alternate": null, "leadingComments": [ { "type": "CommentLine", "value": "TODO: Throw custom exception and wrap arguments into it", "start": 544, "end": 601, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 61 } } }, { "type": "CommentLine", "value": "so that it could be redirected to console.error later.", "start": 607, "end": 663, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 60 } } }, { "type": "CommentLine", "value": "After that improve error messages all over the code.", "start": 669, "end": 723, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 58 } } } ] } ], "directives": [], "trailingComments": null }, "trailingComments": [ { "type": "CommentLine", "value": "for setting names used in sketch matching", "start": 772, "end": 815, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 20, "column": 43 } } } ] }, { "type": "FunctionDeclaration", "start": 817, "end": 1032, "loc": { "start": { "line": 21, "column": 0 }, "end": { "line": 27, "column": 1 } }, "id": { "type": "Identifier", "start": 826, "end": 837, "loc": { "start": { "line": 21, "column": 9 }, "end": { "line": 21, "column": 20 }, "identifierName": "setTestName" }, "name": "setTestName", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 838, "end": 841, "loc": { "start": { "line": 21, "column": 21 }, "end": { "line": 21, "column": 24 }, "identifierName": "obj" }, "name": "obj" }, { "type": "Identifier", "start": 843, "end": 847, "loc": { "start": { "line": 21, "column": 26 }, "end": { "line": 21, "column": 30 }, "identifierName": "name" }, "name": "name" } ], "body": { "type": "BlockStatement", "start": 849, "end": 1032, "loc": { "start": { "line": 21, "column": 32 }, "end": { "line": 27, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 856, "end": 1003, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 25, "column": 6 } }, "expression": { "type": "CallExpression", "start": 856, "end": 1002, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 25, "column": 5 } }, "callee": { "type": "Identifier", "start": 856, "end": 861, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 9 }, "identifierName": "check" }, "name": "check" }, "arguments": [ { "type": "LogicalExpression", "start": 872, "end": 923, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 59 } }, "left": { "type": "BinaryExpression", "start": 872, "end": 898, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 34 } }, "left": { "type": "MemberExpression", "start": 872, "end": 884, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 20 } }, "object": { "type": "Identifier", "start": 872, "end": 875, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 11 }, "identifierName": "obj" }, "name": "obj" }, "property": { "type": "Identifier", "start": 876, "end": 884, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 20 }, "identifierName": "testName" }, "name": "testName" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 889, "end": 898, "loc": { "start": { "line": 23, "column": 25 }, "end": { "line": 23, "column": 34 }, "identifierName": "undefined" }, "name": "undefined" } }, "operator": "||", "right": { "type": "BinaryExpression", "start": 902, "end": 923, "loc": { "start": { "line": 23, "column": 38 }, "end": { "line": 23, "column": 59 } }, "left": { "type": "MemberExpression", "start": 902, "end": 914, "loc": { "start": { "line": 23, "column": 38 }, "end": { "line": 23, "column": 50 } }, "object": { "type": "Identifier", "start": 902, "end": 905, "loc": { "start": { "line": 23, "column": 38 }, "end": { "line": 23, "column": 41 }, "identifierName": "obj" }, "name": "obj" }, "property": { "type": "Identifier", "start": 906, "end": 914, "loc": { "start": { "line": 23, "column": 42 }, "end": { "line": 23, "column": 50 }, "identifierName": "testName" }, "name": "testName" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 919, "end": 923, "loc": { "start": { "line": 23, "column": 55 }, "end": { "line": 23, "column": 59 }, "identifierName": "name" }, "name": "name" } } }, { "type": "BinaryExpression", "start": 934, "end": 995, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 69 } }, "left": { "type": "BinaryExpression", "start": 934, "end": 988, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 62 } }, "left": { "type": "BinaryExpression", "start": 934, "end": 977, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 51 } }, "left": { "type": "StringLiteral", "start": 934, "end": 962, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 36 } }, "extra": { "rawValue": "Overwriting object's name ", "raw": "\"Overwriting object's name \"" }, "value": "Overwriting object's name " }, "operator": "+", "right": { "type": "MemberExpression", "start": 965, "end": 977, "loc": { "start": { "line": 24, "column": 39 }, "end": { "line": 24, "column": 51 } }, "object": { "type": "Identifier", "start": 965, "end": 968, "loc": { "start": { "line": 24, "column": 39 }, "end": { "line": 24, "column": 42 }, "identifierName": "obj" }, "name": "obj" }, "property": { "type": "Identifier", "start": 969, "end": 977, "loc": { "start": { "line": 24, "column": 43 }, "end": { "line": 24, "column": 51 }, "identifierName": "testName" }, "name": "testName" }, "computed": false } }, "operator": "+", "right": { "type": "StringLiteral", "start": 980, "end": 988, "loc": { "start": { "line": 24, "column": 54 }, "end": { "line": 24, "column": 62 } }, "extra": { "rawValue": " with ", "raw": "' with '" }, "value": " with " } }, "operator": "+", "right": { "type": "Identifier", "start": 991, "end": 995, "loc": { "start": { "line": 24, "column": 65 }, "end": { "line": 24, "column": 69 }, "identifierName": "name" }, "name": "name" } } ] } }, { "type": "ExpressionStatement", "start": 1009, "end": 1029, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 1009, "end": 1028, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1009, "end": 1021, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 16 } }, "object": { "type": "Identifier", "start": 1009, "end": 1012, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 7 }, "identifierName": "obj" }, "name": "obj" }, "property": { "type": "Identifier", "start": 1013, "end": 1021, "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 16 }, "identifierName": "testName" }, "name": "testName" }, "computed": false }, "right": { "type": "Identifier", "start": 1024, "end": 1028, "loc": { "start": { "line": 26, "column": 19 }, "end": { "line": 26, "column": 23 }, "identifierName": "name" }, "name": "name" } } } ], "directives": [] }, "leadingComments": [ { "type": "CommentLine", "value": "for setting names used in sketch matching", "start": 772, "end": 815, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 20, "column": 43 } } } ] }, { "type": "FunctionDeclaration", "start": 1034, "end": 1096, "loc": { "start": { "line": 28, "column": 0 }, "end": { "line": 30, "column": 1 } }, "id": { "type": "Identifier", "start": 1043, "end": 1054, "loc": { "start": { "line": 28, "column": 9 }, "end": { "line": 28, "column": 20 }, "identifierName": "getTestName" }, "name": "getTestName" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 1055, "end": 1058, "loc": { "start": { "line": 28, "column": 21 }, "end": { "line": 28, "column": 24 }, "identifierName": "obj" }, "name": "obj" }, { "type": "Identifier", "start": 1060, "end": 1064, "loc": { "start": { "line": 28, "column": 26 }, "end": { "line": 28, "column": 30 }, "identifierName": "name" }, "name": "name" } ], "body": { "type": "BlockStatement", "start": 1066, "end": 1096, "loc": { "start": { "line": 28, "column": 32 }, "end": { "line": 30, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 1073, "end": 1093, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 24 } }, "argument": { "type": "MemberExpression", "start": 1080, "end": 1092, "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 29, "column": 23 } }, "object": { "type": "Identifier", "start": 1080, "end": 1083, "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 29, "column": 14 }, "identifierName": "obj" }, "name": "obj" }, "property": { "type": "Identifier", "start": 1084, "end": 1092, "loc": { "start": { "line": 29, "column": 15 }, "end": { "line": 29, "column": 23 }, "identifierName": "testName" }, "name": "testName" }, "computed": false } } ], "directives": [] } }, { "type": "FunctionDeclaration", "start": 1100, "end": 1412, "loc": { "start": { "line": 32, "column": 0 }, "end": { "line": 37, "column": 1 } }, "id": { "type": "Identifier", "start": 1109, "end": 1120, "loc": { "start": { "line": 32, "column": 9 }, "end": { "line": 32, "column": 20 }, "identifierName": "_convVector" }, "name": "_convVector" }, "generator": false, "expression": false, "async": f