UNPKG

awv3

Version:
1,444 lines (1,443 loc) 207 kB
{ "type": "File", "start": 0, "end": 976, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 30, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 976, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 30, "column": 0 } }, "sourceType": "module", "body": [ { "type": "FunctionDeclaration", "start": 0, "end": 296, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 10, "column": 1 } }, "id": { "type": "Identifier", "start": 9, "end": 14, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 14 }, "identifierName": "parse" }, "name": "parse" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 15, "end": 21, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 21 }, "identifierName": "string" }, "name": "string" }, { "type": "Identifier", "start": 23, "end": 35, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 35 }, "identifierName": "restrictions" }, "name": "restrictions" } ], "body": { "type": "BlockStatement", "start": 37, "end": 296, "loc": { "start": { "line": 1, "column": 37 }, "end": { "line": 10, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 43, "end": 83, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 44 } }, "declarations": [ { "type": "VariableDeclarator", "start": 47, "end": 82, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 43 } }, "id": { "type": "Identifier", "start": 47, "end": 53, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 14 }, "identifierName": "tokens" }, "name": "tokens" }, "init": { "type": "CallExpression", "start": 56, "end": 82, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 43 } }, "callee": { "type": "MemberExpression", "start": 56, "end": 75, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 36 } }, "object": { "type": "CallExpression", "start": 56, "end": 69, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 30 } }, "callee": { "type": "MemberExpression", "start": 56, "end": 67, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 28 } }, "object": { "type": "Identifier", "start": 56, "end": 62, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 23 }, "identifierName": "string" }, "name": "string" }, "property": { "type": "Identifier", "start": 63, "end": 67, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 28 }, "identifierName": "trim" }, "name": "trim" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 70, "end": 75, "loc": { "start": { "line": 2, "column": 31 }, "end": { "line": 2, "column": 36 }, "identifierName": "split" }, "name": "split" }, "computed": false }, "arguments": [ { "type": "RegExpLiteral", "start": 76, "end": 81, "loc": { "start": { "line": 2, "column": 37 }, "end": { "line": 2, "column": 42 } }, "extra": { "raw": "/\\s+/" }, "pattern": "\\s+", "flags": "" } ] } } ], "kind": "let" }, { "type": "WhileStatement", "start": 88, "end": 294, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 9, "column": 5 } }, "test": { "type": "BinaryExpression", "start": 95, "end": 114, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 30 } }, "left": { "type": "MemberExpression", "start": 95, "end": 108, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 24 } }, "object": { "type": "Identifier", "start": 95, "end": 101, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 17 }, "identifierName": "tokens" }, "name": "tokens" }, "property": { "type": "Identifier", "start": 102, "end": 108, "loc": { "start": { "line": 3, "column": 18 }, "end": { "line": 3, "column": 24 }, "identifierName": "length" }, "name": "length" }, "computed": false }, "operator": "!==", "right": { "type": "NumericLiteral", "start": 113, "end": 114, "loc": { "start": { "line": 3, "column": 29 }, "end": { "line": 3, "column": 30 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } }, "body": { "type": "BlockStatement", "start": 116, "end": 294, "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 9, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 126, "end": 154, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 36 } }, "declarations": [ { "type": "VariableDeclarator", "start": 132, "end": 153, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 35 } }, "id": { "type": "Identifier", "start": 132, "end": 136, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 18 }, "identifierName": "name" }, "name": "name" }, "init": { "type": "CallExpression", "start": 139, "end": 153, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 35 } }, "callee": { "type": "MemberExpression", "start": 139, "end": 151, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 33 } }, "object": { "type": "Identifier", "start": 139, "end": 145, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 27 }, "identifierName": "tokens" }, "name": "tokens" }, "property": { "type": "Identifier", "start": 146, "end": 151, "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 33 }, "identifierName": "shift" }, "name": "shift" }, "computed": false }, "arguments": [] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 163, "end": 200, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 45 } }, "declarations": [ { "type": "VariableDeclarator", "start": 169, "end": 199, "loc": { "start": { "line": 5, "column": 14 }, "end": { "line": 5, "column": 44 } }, "id": { "type": "Identifier", "start": 169, "end": 174, "loc": { "start": { "line": 5, "column": 14 }, "end": { "line": 5, "column": 19 }, "identifierName": "value" }, "name": "value" }, "init": { "type": "CallExpression", "start": 177, "end": 199, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 44 } }, "callee": { "type": "Identifier", "start": 177, "end": 183, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 28 }, "identifierName": "Number" }, "name": "Number" }, "arguments": [ { "type": "CallExpression", "start": 184, "end": 198, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 43 } }, "callee": { "type": "MemberExpression", "start": 184, "end": 196, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 41 } }, "object": { "type": "Identifier", "start": 184, "end": 190, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 35 }, "identifierName": "tokens" }, "name": "tokens" }, "property": { "type": "Identifier", "start": 191, "end": 196, "loc": { "start": { "line": 5, "column": 36 }, "end": { "line": 5, "column": 41 }, "identifierName": "shift" }, "name": "shift" }, "computed": false }, "arguments": [] } ] } } ], "kind": "const" }, { "type": "IfStatement", "start": 209, "end": 252, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 7, "column": 21 } }, "test": { "type": "UnaryExpression", "start": 213, "end": 229, "loc": { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 28 } }, "operator": "!", "prefix": true, "argument": { "type": "CallExpression", "start": 214, "end": 229, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 28 } }, "callee": { "type": "Identifier", "start": 214, "end": 222, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 21 }, "identifierName": "isFinite" }, "name": "isFinite" }, "arguments": [ { "type": "Identifier", "start": 223, "end": 228, "loc": { "start": { "line": 6, "column": 22 }, "end": { "line": 6, "column": 27 }, "identifierName": "value" }, "name": "value" } ] }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "ContinueStatement", "start": 243, "end": 252, "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 21 } }, "label": null }, "alternate": null }, { "type": "ExpressionStatement", "start": 261, "end": 288, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 35 } }, "expression": { "type": "AssignmentExpression", "start": 261, "end": 287, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 34 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 261, "end": 279, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 26 } }, "object": { "type": "Identifier", "start": 261, "end": 273, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 20 }, "identifierName": "restrictions" }, "name": "restrictions" }, "property": { "type": "Identifier", "start": 274, "end": 278, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 25 }, "identifierName": "name" }, "name": "name" }, "computed": true }, "right": { "type": "Identifier", "start": 282, "end": 287, "loc": { "start": { "line": 8, "column": 29 }, "end": { "line": 8, "column": 34 }, "identifierName": "value" }, "name": "value" } } } ], "directives": [] } } ], "directives": [] } }, { "type": "ExportDefaultDeclaration", "start": 298, "end": 975, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 29, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 313, "end": 975, "loc": { "start": { "line": 12, "column": 15 }, "end": { "line": 29, "column": 1 } }, "id": { "type": "Identifier", "start": 322, "end": 336, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 38 }, "identifierName": "observeConsole" }, "name": "observeConsole" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 337, "end": 351, "loc": { "start": { "line": 12, "column": 39 }, "end": { "line": 12, "column": 53 }, "identifierName": "consoleElement" }, "name": "consoleElement" }, { "type": "Identifier", "start": 353, "end": 365, "loc": { "start": { "line": 12, "column": 55 }, "end": { "line": 12, "column": 67 }, "identifierName": "handlerThunk" }, "name": "handlerThunk" }, { "type": "Identifier", "start": 367, "end": 380, "loc": { "start": { "line": 12, "column": 69 }, "end": { "line": 12, "column": 82 }, "identifierName": "useNewConsole" }, "name": "useNewConsole" } ], "body": { "type": "BlockStatement", "start": 382, "end": 975, "loc": { "start": { "line": 12, "column": 84 }, "end": { "line": 29, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 388, "end": 717, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 21, "column": 7 } }, "expression": { "type": "CallExpression", "start": 388, "end": 716, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 21, "column": 6 } }, "callee": { "type": "MemberExpression", "start": 388, "end": 410, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 26 } }, "object": { "type": "Identifier", "start": 388, "end": 402, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 18 }, "identifierName": "consoleElement" }, "name": "consoleElement" }, "property": { "type": "Identifier", "start": 403, "end": 410, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 26 }, "identifierName": "observe" }, "name": "observe" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 411, "end": 435, "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 51 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 411, "end": 416, "loc": { "start": { "line": 13, "column": 27 }, "end": { "line": 13, "column": 32 }, "identifierName": "state" }, "name": "state" } ], "body": { "type": "MemberExpression", "start": 420, "end": 435, "loc": { "start": { "line": 13, "column": 36 }, "end": { "line": 13, "column": 51 } }, "object": { "type": "Identifier", "start": 420, "end": 425, "loc": { "start": { "line": 13, "column": 36 }, "end": { "line": 13, "column": 41 }, "identifierName": "state" }, "name": "state" }, "property": { "type": "Identifier", "start": 426, "end": 435, "loc": { "start": { "line": 13, "column": 42 }, "end": { "line": 13, "column": 51 }, "identifierName": "lastEvent" }, "name": "lastEvent" }, "computed": false } }, { "type": "ArrowFunctionExpression", "start": 437, "end": 715, "loc": { "start": { "line": 13, "column": 53 }, "end": { "line": 21, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 437, "end": 442, "loc": { "start": { "line": 13, "column": 53 }, "end": { "line": 13, "column": 58 }, "identifierName": "event" }, "name": "event" } ], "body": { "type": "BlockStatement", "start": 446, "end": 715, "loc": { "start": { "line": 13, "column": 62 }, "end": { "line": 21, "column": 5 } }, "body": [ { "type": "IfStatement", "start": 456, "end": 485, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 37 } }, "test": { "type": "UnaryExpression", "start": 460, "end": 476, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 28 } }, "operator": "!", "prefix": true, "argument": { "type": "CallExpression", "start": 461, "end": 476, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 28 } }, "callee": { "type": "Identifier", "start": 461, "end": 474, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 26 }, "identifierName": "useNewConsole" }, "name": "useNewConsole" }, "arguments": [] }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "ReturnStatement", "start": 478, "end": 485, "loc": { "start": { "line": 14, "column": 30 }, "end": { "line": 14, "column": 37 } }, "argument": null }, "alternate": null }, { "type": "IfStatement", "start": 494, "end": 709, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 20, "column": 9 } }, "test": { "type": "BinaryExpression", "start": 498, "end": 519, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 33 } }, "left": { "type": "MemberExpression", "start": 498, "end": 507, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 21 } }, "object": { "type": "Identifier", "start": 498, "end": 503, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 17 }, "identifierName": "event" }, "name": "event" }, "property": { "type": "Identifier", "start": 504, "end": 507, "loc": { "start": { "line": 15, "column": 18 }, "end": { "line": 15, "column": 21 }, "identifierName": "key" }, "name": "key" }, "computed": false }, "operator": "===", "right": { "type": "StringLiteral", "start": 512, "end": 519, "loc": { "start": { "line": 15, "column": 26 }, "end": { "line": 15, "column": 33 } }, "extra": { "rawValue": "Enter", "raw": "'Enter'" }, "value": "Enter" } }, "consequent": { "type": "BlockStatement", "start": 521, "end": 709, "loc": { "start": { "line": 15, "column": 35 }, "end": { "line": 20, "column": 9 } }, "body": [ { "type": "VariableDeclaration", "start": 535, "end": 568, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 45 } }, "declarations": [ { "type": "VariableDeclarator",