You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Single-line comments in JSON are defined in the same way they are in JavaScript:
fragment Single_Line_Comment
: '//' Input_Character*
;
fragment Input_Character
// anything but New_Line_Character
: ~('\u000D' | '\u000A' | '\u0085' | '\u2028' | '\u2029')
;
fragment New_Line_Character
: '\u000D' // carriage return
| '\u000A' // line feed
| '\u0085' // next line
| '\u2028' // line separator
| '\u2029' // paragraph separator
;
👆🏻 multiline comment lexical structure excluded.
This issue requests the addition of support for single-line comments to the JSON library even though they aren't an official part of the spec. Many developers still add comments to JSON files and the JsonLexercould simply discard those, but that's likely a better decision for the consumer to make instead.
Acceptance Criteria
JsonLexer returns CommentToken for single-line comments.
Column number advances when horizontal movement is captured.
Line number advances when vertical movement is captured.
Column number is reset to 0 when line number advances.
Captured comments exclude whitespace.
👆🏻 this should be configurable.
Test coverage for implementation.
The text was updated successfully, but these errors were encountered:
Single-line comments in JSON are defined in the same way they are in JavaScript:
👆🏻 multiline comment lexical structure excluded.
This issue requests the addition of support for single-line comments to the JSON library even though they aren't an official part of the spec. Many developers still add comments to JSON files and the
JsonLexer
could simply discard those, but that's likely a better decision for the consumer to make instead.Acceptance Criteria
JsonLexer
returnsCommentToken
for single-line comments.0
when line number advances.The text was updated successfully, but these errors were encountered: