UNPKG

dirtybomb

Version:
903 lines 25.1 kB
{ "type": "Program", "body": [ { "type": "ExpressionStatement", "expression": { "type": "Literal", "value": "use strict", "raw": "\"use strict\"", "range": [ 41, 53 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 12 } } }, "range": [ 41, 54 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 13 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Created by austin on 6/8/16.\n ", "range": [ 0, 39 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n *\n * http://mathjs.org/examples/advanced/custom_argument_parsing.js.html\n *\n * @param {number} start\n * @param {number} end\n * @param {function} func\n * @param {number} [step=0.01]\n * @returns {number}\n ", "range": [ 56, 266 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 16, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "integrate", "range": [ 283, 292 ], "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 25 } } }, "params": [ { "type": "Identifier", "name": "start", "range": [ 293, 298 ], "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 31 } } }, { "type": "Identifier", "name": "end", "range": [ 300, 303 ], "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 36 } } }, { "type": "Identifier", "name": "func", "range": [ 305, 309 ], "loc": { "start": { "line": 17, "column": 38 }, "end": { "line": 17, "column": 42 } } }, { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "step", "range": [ 311, 315 ], "loc": { "start": { "line": 17, "column": 44 }, "end": { "line": 17, "column": 48 } } }, "right": { "type": "Literal", "value": 0.01, "raw": "0.01", "range": [ 318, 322 ], "loc": { "start": { "line": 17, "column": 51 }, "end": { "line": 17, "column": 55 } } }, "range": [ 311, 322 ], "loc": { "start": { "line": 17, "column": 44 }, "end": { "line": 17, "column": 55 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "total", "range": [ 334, 339 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 13 } } }, "init": { "type": "Literal", "value": 0, "raw": "0", "range": [ 342, 343 ], "loc": { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 17 } } }, "range": [ 334, 343 ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 17 } } } ], "kind": "let", "range": [ 330, 344 ], "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 18 } } }, { "type": "ForStatement", "init": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "x", "range": [ 358, 359 ], "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 14 } } }, "init": { "type": "Identifier", "name": "start", "range": [ 362, 367 ], "loc": { "start": { "line": 19, "column": 17 }, "end": { "line": 19, "column": 22 } } }, "range": [ 358, 367 ], "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 22 } } } ], "kind": "let", "range": [ 354, 367 ], "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 22 } } }, "test": { "type": "BinaryExpression", "operator": "<", "left": { "type": "Identifier", "name": "x", "range": [ 369, 370 ], "loc": { "start": { "line": 19, "column": 24 }, "end": { "line": 19, "column": 25 } } }, "right": { "type": "Identifier", "name": "end", "range": [ 373, 376 ], "loc": { "start": { "line": 19, "column": 28 }, "end": { "line": 19, "column": 31 } } }, "range": [ 369, 376 ], "loc": { "start": { "line": 19, "column": 24 }, "end": { "line": 19, "column": 31 } } }, "update": { "type": "AssignmentExpression", "operator": "+=", "left": { "type": "Identifier", "name": "x", "range": [ 378, 379 ], "loc": { "start": { "line": 19, "column": 33 }, "end": { "line": 19, "column": 34 } } }, "right": { "type": "Identifier", "name": "step", "range": [ 383, 387 ], "loc": { "start": { "line": 19, "column": 38 }, "end": { "line": 19, "column": 42 } } }, "range": [ 378, 387 ], "loc": { "start": { "line": 19, "column": 33 }, "end": { "line": 19, "column": 42 } } }, "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "+=", "left": { "type": "Identifier", "name": "total", "range": [ 399, 404 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 13 } } }, "right": { "type": "BinaryExpression", "operator": "*", "left": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "func", "range": [ 408, 412 ], "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 21 } } }, "arguments": [ { "type": "BinaryExpression", "operator": "+", "left": { "type": "Identifier", "name": "x", "range": [ 413, 414 ], "loc": { "start": { "line": 20, "column": 22 }, "end": { "line": 20, "column": 23 } } }, "right": { "type": "BinaryExpression", "operator": "/", "left": { "type": "Identifier", "name": "step", "range": [ 417, 421 ], "loc": { "start": { "line": 20, "column": 26 }, "end": { "line": 20, "column": 30 } } }, "right": { "type": "Literal", "value": 2, "raw": "2", "range": [ 424, 425 ], "loc": { "start": { "line": 20, "column": 33 }, "end": { "line": 20, "column": 34 } } }, "range": [ 417, 425 ], "loc": { "start": { "line": 20, "column": 26 }, "end": { "line": 20, "column": 34 } } }, "range": [ 413, 425 ], "loc": { "start": { "line": 20, "column": 22 }, "end": { "line": 20, "column": 34 } } } ], "range": [ 408, 426 ], "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 35 } } }, "right": { "type": "Identifier", "name": "step", "range": [ 429, 433 ], "loc": { "start": { "line": 20, "column": 38 }, "end": { "line": 20, "column": 42 } } }, "range": [ 408, 433 ], "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 42 } } }, "range": [ 399, 433 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 42 } } }, "range": [ 399, 434 ], "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 43 } } } ], "range": [ 389, 440 ], "loc": { "start": { "line": 19, "column": 44 }, "end": { "line": 21, "column": 5 } } }, "range": [ 349, 440 ], "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 21, "column": 5 } } }, { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "total", "range": [ 452, 457 ], "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 16 } } }, "range": [ 445, 458 ], "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 17 } } } ], "range": [ 324, 460 ], "loc": { "start": { "line": 17, "column": 57 }, "end": { "line": 23, "column": 1 } } }, "generator": false, "expression": false, "range": [ 274, 460 ], "loc": { "start": { "line": 17, "column": 7 }, "end": { "line": 23, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n *\n * http://mathjs.org/examples/advanced/custom_argument_parsing.js.html\n *\n * @param {number} start\n * @param {number} end\n * @param {function} func\n * @param {number} [step=0.01]\n * @returns {number}\n ", "range": [ 56, 266 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 16, "column": 3 } } } ], "trailingComments": [] }, "specifiers": [], "source": null, "range": [ 267, 460 ], "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 23, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n *\n * http://mathjs.org/examples/advanced/custom_argument_parsing.js.html\n *\n * @param {number} start\n * @param {number} end\n * @param {function} func\n * @param {number} [step=0.01]\n * @returns {number}\n ", "range": [ 56, 266 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 16, "column": 3 } } } ] } ], "sourceType": "module", "range": [ 41, 460 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 23, "column": 1 } }, "comments": [ { "type": "Block", "value": "*\n * Created by austin on 6/8/16.\n ", "range": [ 0, 39 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } }, { "type": "Block", "value": "*\n *\n * http://mathjs.org/examples/advanced/custom_argument_parsing.js.html\n *\n * @param {number} start\n * @param {number} end\n * @param {function} func\n * @param {number} [step=0.01]\n * @returns {number}\n ", "range": [ 56, 266 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 16, "column": 3 } } } ] }