Note non-reentrancy of parser in onComment docs

Closes #80
This commit is contained in:
Marijn Haverbeke 2013-11-20 10:59:12 +01:00
parent baaa16cee7
commit b1623b10c1
3 changed files with 7 additions and 2 deletions

View File

@ -78,6 +78,9 @@ object referring to that same position.
of the comments 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

View File

@ -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

View File

@ -50,7 +50,8 @@ boolean indicating whether this is a block (<code>/* */</code>) comment,
character offsets that denote the start and end of the comment.
When the <code>locations</code> option is on, two more parameters are
passed, the full <code>{line, column}</code> locations of the start and
end of the comments.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">onComment</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>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.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">onComment</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Nodes have their start and end characters offsets recorded in
<code>start</code> and <code>end</code> properties (directly on the node, rather than
the <code>loc</code> object, which holds line/column data. To also add a
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=745678">semi-standardized</a> <code>range</code> property holding a <code>[start,