{"id":17922642,"url":"https://github.com/rreverser/biscript","last_synced_at":"2025-04-03T08:47:23.464Z","repository":{"id":18858227,"uuid":"22074797","full_name":"RReverser/biscript","owner":"RReverser","description":"010 Editor's binary scripts on top of JavaScrpit","archived":false,"fork":false,"pushed_at":"2014-07-23T10:18:00.000Z","size":996,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T22:22:14.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RReverser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-21T18:12:21.000Z","updated_at":"2021-04-17T03:21:42.000Z","dependencies_parsed_at":"2022-09-25T02:51:21.788Z","dependency_job_id":null,"html_url":"https://github.com/RReverser/biscript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fbiscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fbiscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fbiscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fbiscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RReverser","download_url":"https://codeload.github.com/RReverser/biscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246970340,"owners_count":20862508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T20:40:13.755Z","updated_at":"2025-04-03T08:47:23.443Z","avatar_url":"https://github.com/RReverser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Acorn (Binary Scripts edition)\n\n[![Build Status](https://travis-ci.org/RReverser/biscript.svg)](https://travis-ci.org/RReverser/biscript)\n\nThis is modification of [Acorn][acorn] - a tiny, fast JavaScript parser, written completely in JavaScript.\n\nIt aims to implement [010 Editor][010-editor] syntax used for [binary templates][binary-templates] on top of\nJavaScript so resulting AST could be transpiled to native JavaScript with usage of [jBinary][jbinary] type structures.\n\n[acorn]: http://marijnhaverbeke.nl/acorn/\n[010-editor]: http://www.sweetscape.com/010editor/\n[binary-templates]: http://www.sweetscape.com/010editor/templates.html\n[jbinary]: https://jdataview.github.io/jBinary\n\n## Installation\n\nThe easiest way to install acorn is with [`npm`][npm].\n\n[npm]: http://npmjs.org\n\n```sh\nnpm install acorn\n```\n\nAlternately, download the source.\n\n```sh\ngit clone https://github.com/marijnh/acorn.git\n```\n\n## Components\n\nWhen run in a CommonJS (node.js) or AMD environment, exported values\nappear in the interfaces exposed by the individual files, as usual.\nWhen loaded in the browser (Acorn works in any JS-enabled browser more\nrecent than IE5) without any kind of module management, a single\nglobal object `acorn` will be defined, and all the exported properties\nwill be added to that.\n\n### acorn.js\n\nThis file contains the actual parser (and is what you get when you\n`require(\"acorn\")` in node.js).\n\n**parse**`(input, options)` is used to parse a JavaScript program.\nThe `input` parameter is a string, `options` can be undefined or an\nobject setting some of the options listed below. The return value will\nbe an abstract syntax tree object as specified by the\n[Mozilla Parser API][mozapi].\n\nWhen  encountering   a  syntax   error,  the   parser  will   raise  a\n`SyntaxError` object with a meaningful  message. The error object will\nhave a `pos` property that indicates the character offset at which the\nerror occurred,  and a `loc`  object that contains a  `{line, column}`\nobject referring to that same position.\n\n[mozapi]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\n\n- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be\n  either 3, 5, or 6. This influences support for strict mode, the set\n  of reserved words, and support for getters and setter. Default is 5.\n  ES6 is only partially supported.\n\n- **strictSemicolons**: If `true`, prevents the parser from doing\n  automatic semicolon insertion, and statements that do not end with\n  a semicolon will generate an error. Defaults to `false`.\n\n- **allowTrailingCommas**: If `false`, the parser will not allow\n  trailing commas in array and object literals. Default is `true`.\n\n- **forbidReserved**: If `true`, using a reserved word will generate\n  an error. Defaults to `false`. When given the value `\"everywhere\"`,\n  reserved words and keywords can also not be used as property names\n  (as in Internet Explorer's old parser).\n  \n- **allowReturnOutsideFunction**: By default, a return statement at\n  the top level raises an error. Set this to `true` to accept such\n  code.\n\n- **locations**: When `true`, each node has a `loc` object attached\n  with `start` and `end` subobjects, each of which contains the\n  one-based line and zero-based column numbers in `{line, column}`\n  form. Default is `false`.\n\n- **onComment**: If a function is passed for this option, whenever a\n  comment is encountered the function will be called with the\n  following parameters:\n\n  - `block`: `true` if the comment is a block comment, false if it\n    is a line comment.\n  - `text`: The content of the comment.\n  - `start`: Character offset of the start of the comment.\n  - `end`: Character offset of the end of the comment.\n\n  When the `locations` options is on, the `{line, column}` locations\n  of the comment’s start and end are passed as two additional\n  parameters.\n\n  Note that you are not allowed to call the parser from the\n  callback—that will corrupt its internal state.\n\n- **ranges**: Nodes have their start and end characters offsets\n  recorded in `start` and `end` properties (directly on the node,\n  rather than the `loc` object, which holds line/column data. To also\n  add a [semi-standardized][range] \"range\" property holding a\n  `[start, end]` array with the same numbers, set the `ranges` option\n  to `true`.\n\n- **program**: It is possible to parse multiple files into a single\n  AST by passing the tree produced by parsing the first file as the\n  `program` option in subsequent parses. This will add the toplevel\n  forms of the parsed file to the \"Program\" (top) node of an existing\n  parse tree.\n\n- **sourceFile**: When the `locations` option is `true`, you can pass\n  this option to add a `sourceFile` attribute in every node’s `loc`\n  object. Note that the contents of this option are not examined or\n  processed in any way; you are free to use whatever format you\n  choose.\n\n- **directSourceFile**: Like `sourceFile`, but the property will be\n  added directly to the nodes, rather than to a `loc` object.\n\n[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n\n**getLineInfo**`(input, offset)` can be used to get a `{line,\ncolumn}` object for a given program string and character offset.\n\n**tokenize**`(input, options)` exports a primitive interface to\nAcorn's tokenizer. The function takes an input string and options\nsimilar to `parse` (though only some options are meaningful here), and\nreturns a function that can be called repeatedly to read a single\ntoken, and returns a `{start, end, type, value}` object (with added\n`startLoc` and `endLoc` properties when the `locations` option is\nenabled). This object will be reused (updated) for each token, so you\ncan't count on it staying stable.\n\n**tokTypes** holds an object mapping names to the token type objects\nthat end up in the `type` properties of tokens.\n\n### util/walk.js ###\n\nImplements an abstract syntax tree walker. Will store its interface in\n`acorn.walk` when used without a module system.\n\n**simple**`(node, visitors, base, state)` does a 'simple' walk over\na tree. `node` should be the AST node to walk, and `visitors` an\nobject with properties whose names correspond to node types in the\n[Mozilla Parser API][mozapi]. The properties should contain functions\nthat will be called with the node object and, if applicable the state\nat that point. The last two arguments are optional. `base` is a walker\nalgorithm, and `state` is a start state. The default walker will\nsimply visit all statements and expressions and not produce a\nmeaningful state. (An example of a use of state it to track scope at\neach point in the tree.)\n\n**ancestor**`(node, visitors, base, state)` does a 'simple' walk over\na tree, building up an array of ancestor nodes (including the current node)\nand passing the array to callbacks in the `state` parameter.\n\n**recursive**`(node, state, functions, base)` does a 'recursive'\nwalk, where the walker functions are responsible for continuing the\nwalk on the child nodes of their target node. `state` is the start\nstate, and `functions` should contain an object that maps node types\nto walker functions. Such functions are called with `(node, state, c)`\narguments, and can cause the walk to continue on a sub-node by calling\nthe `c` argument on it with `(node, state)` arguments. The optional\n`base` argument provides the fallback walker functions for node types\nthat aren't handled in the `functions` object. If not given, the\ndefault walkers will be used.\n\n**make**`(functions, base)` builds a new walker object by using the\nwalker functions in `functions` and filling in the missing ones by\ntaking defaults from `base`.\n\n**findNodeAt**`(node, start, end, test, base, state)` tries to\nlocate a node in a tree at the given start and/or end offsets, which\nsatisfies the predicate `test`. `start` end `end` can be either `null`\n(as wildcard) or a number. `test` may be a string (indicating a node\ntype) or a function that takes `(nodeType, node)` arguments and\nreturns a boolean indicating whether this node is interesting. `base`\nand `state` are optional, and can be used to specify a custom walker.\nNodes are tested from inner to outer, so if two nodes match the\nboundaries, the inner one will be preferred.\n\n**findNodeAround**`(node, pos, test, base, state)` is a lot like\n`findNodeAt`, but will match any node that exists 'around' (spanning)\nthe given position.\n\n**findNodeAfter**`(node, pos, test, base, state)` is similar to\n`findNodeAround`, but will match all nodes *after* the given position\n(testing outer nodes before inner nodes).\n\n## Command line interface\n\nThe `bin/acorn` utility can be used to parse a file from the command\nline. It accepts as arguments its input file and the following\noptions:\n\n- `--ecma3|--ecma5`: Sets the ECMAScript version to parse. Default is\n  version 5.\n\n- `--strictSemicolons`: Prevents the parser from doing automatic\n  semicolon insertion. Statements that do not end in semicolons will\n  generate an error.\n\n- `--locations`: Attaches a \"loc\" object to each node with \"start\" and\n  \"end\" subobjects, each of which contains the one-based line and\n  zero-based column numbers in `{line, column}` form.\n\n- `--compact`: No whitespace is used in the AST output.\n\n- `--silent`: Do not output the AST, just return the exit status.\n\n- `--help`: Print the usage information and quit.\n\nThe utility spits out the syntax tree as JSON data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frreverser%2Fbiscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frreverser%2Fbiscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frreverser%2Fbiscript/lists"}