Lines Matching +full:github +full:- +full:token

3 [![Build Status](https://travis-ci.org/ternjs/acorn.svg?branch=master)](https://travis-ci.org/ternj…
13 [MIT license](https://github.com/ternjs/acorn/blob/master/LICENSE).
16 [report bugs](https://github.com/ternjs/acorn/issues) or create pull
17 requests on [github](https://github.com/ternjs/acorn). For questions
34 git clone https://github.com/ternjs/acorn.git
41 When loaded in the browser (Acorn works in any JS-enabled browser more
63 [estree]: https://github.com/estree/estree
65 - **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
73 - **sourceType**: Indicate the mode the code should be parsed in. Can be
77 - **onInsertedSemicolon**: If given a callback, that callback will be
83 - **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
86 - **allowReserved**: If `false`, using a reserved word will generate
92 - **allowReturnOutsideFunction**: By default, a return statement at
96 - **allowImportExportEverywhere**: By default, `import` and `export`
100 - **allowHashBang**: When this is enabled (off by default), if the
104 - **locations**: When `true`, each node has a `loc` object attached
106 one-based line and zero-based column numbers in `{line, column}`
109 - **onToken**: If a function is passed for this option, each found
110 token will be passed in same format as tokens returned from
113 If array is passed, each found token is pushed to it.
118 - **onComment**: If a function is passed for this option, whenever a
122 - `block`: `true` if the comment is a block comment, false if it
124 - `text`: The content of the comment.
125 - `start`: Character offset of the start of the comment.
126 - `end`: Character offset of the end of the comment.
154 - **ranges**: Nodes have their start and end characters offsets
157 add a [semi-standardized][range] `range` property holding a
161 - **program**: It is possible to parse multiple files into a single
167 - **sourceFile**: When the `locations` option is `true`, you can pass
173 - **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
177 - **preserveParens**: If this option is `true`, parenthesized expressions
178 are represented by (non-standard) `ParenthesizedExpression` nodes
192 method that can be called repeatedly to get the next token, a `{start,
195 option is enabled). When the token's type is `tokTypes.eof`, you
197 token forever.
200 protocol-compliant iterable:
203 for (let token of acorn.tokenizer(str)) {
211 **tokTypes** holds an object mapping names to the token type objects
217 Esprima-specific format. In order to simulate same format in
228 // collect token ranges
240 [escodegen]: https://github.com/estools/escodegen
244 This file implements an error-tolerant parser. It exposes a single
280 arguments, and can cause the walk to continue on a sub-node by calling
314 - `--ecma3|--ecma5|--ecma6|--ecma7`: Sets the ECMAScript version to parse. Default is
317 - `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
319 - `--locations`: Attaches a "loc" object to each node with "start" and
320 "end" subobjects, each of which contains the one-based line and
321 zero-based column numbers in `{line, column}` form.
323 - `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first l…
325 - `--compact`: No whitespace is used in the AST output.
327 - `--silent`: Do not output the AST, just return the exit status.
329 - `--help`: Print the usage information and quit.
341 The command-line test runner (`npm test`) uses the ES6 modules. The
342 browser-based test page (`test/index.html`) uses the compiled modules.
343 The `bin/build-acorn.js` script builds the latter from the former.
349 require("babel-core/register")
356 bounds, redefine the way the parser works. Plugins can add new token
364 parsing types and a plugin for parsing JSX-style XML literals, you
380 console.log("Reading a token!")
397 console.log("Reading a token in the loose parser!")
405- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](ht…
406- [`acorn-es7-plugin`](https://github.com/MatAtBread/acorn-es7-plugin/): Parse [async/await syntax…
407- [`acorn-object-spread`](https://github.com/UXtemple/acorn-object-spread): Parse [object spread s…
408- [`acorn-es7`](https://www.npmjs.com/package/acorn-es7): Parse [decorator syntax proposal](https:…
409- [`acorn-objj`](https://www.npmjs.com/package/acorn-objj): [Objective-J](http://www.cappuccino-pr…