diff --git a/README.md b/README.md index 80b0fbd354..a4f5fbf47b 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,9 @@ object referring to that same position. of the comment’s start and end are passed as two additional parameters. + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + - **ranges**: Nodes have their start and end characters offsets recorded in `start` and `end` properties (directly on the node, rather than the `loc` object, which holds line/column data. To also diff --git a/acorn.js b/acorn.js index ec3d4ed7e2..bbd32cfcea 100644 --- a/acorn.js +++ b/acorn.js @@ -77,7 +77,8 @@ // character offsets that denote the start and end of the comment. // When the `locations` option is on, two more parameters are // passed, the full `{line, column}` locations of the start and - // end of the comments. + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. onComment: null, // Nodes have their start and end characters offsets recorded in // `start` and `end` properties (directly on the node, rather than diff --git a/index.html b/index.html index 9c86b83d78..c1df00bd45 100644 --- a/index.html +++ b/index.html @@ -50,7 +50,8 @@ boolean indicating whether this is a block (/* */) comment, character offsets that denote the start and end of the comment. When the locations option is on, two more parameters are passed, the full {line, column} locations of the start and -end of the comments.

    onComment: null,

Nodes have their start and end characters offsets recorded in +end of the comments. Note that you are not allowed to call the +parser from the callback—that will corrupt its internal state.

    onComment: null,

Nodes have their start and end characters offsets recorded in start and end properties (directly on the node, rather than the loc object, which holds line/column data. To also add a semi-standardized range property holding a [start,