We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When concatenating consequent character tokens, streaming variants of the parser don't correctly merge location information.
I found related issue #153 where endOffset was fixed for SAXParser, but endLine and endCol are still invalid and correspond to the first token.
endOffset
endLine
endCol
Test for the RewritingStream (not for SAXParser as initially I thought the problem is specific to the rewriter) as an example of the issue:
RewritingStream
SAXParser
exports['RewritingStream - Should return location for entire text span'] = createRewriterTest({ src: 'te\n st', expected: '', assignTokenHandlers: rewriter => { rewriter.on('text', token => { assert.deepStrictEqual(token, { text: 'te\n st', sourceCodeLocation: { startLine: 1, startCol: 1, startOffset: 0, endLine: 2, // returns 1 instead endCol: 4, // returns 3 instead endOffset: 6 } }); }); } });
The text was updated successfully, but these errors were encountered:
Fix SAXParser text location
8af00ca
Fixes #266.
c6d0fb5
Successfully merging a pull request may close this issue.
When concatenating consequent character tokens, streaming variants of the parser don't correctly merge location information.
I found related issue #153 where
endOffset
was fixed for SAXParser, butendLine
andendCol
are still invalid and correspond to the first token.Test for the
RewritingStream
(not forSAXParser
as initially I thought the problem is specific to the rewriter) as an example of the issue:The text was updated successfully, but these errors were encountered: