[lua] Fix parsing of short/long comments
This commit is contained in:
@ -525,6 +525,11 @@ HexDigit
|
|||||||
: [0-9a-fA-F]
|
: [0-9a-fA-F]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
fragment
|
||||||
|
StartingSingleCommentLineInputCharacter
|
||||||
|
: ~[[\r\n\u0085\u2028\u2029]
|
||||||
|
;
|
||||||
|
|
||||||
fragment
|
fragment
|
||||||
SingleLineInputCharacter
|
SingleLineInputCharacter
|
||||||
: ~[\r\n\u0085\u2028\u2029]
|
: ~[\r\n\u0085\u2028\u2029]
|
||||||
@ -535,7 +540,7 @@ COMMENT
|
|||||||
;
|
;
|
||||||
|
|
||||||
LINE_COMMENT
|
LINE_COMMENT
|
||||||
: '--' SingleLineInputCharacter* -> channel(HIDDEN)
|
: '--' (NL | StartingSingleCommentLineInputCharacter SingleLineInputCharacter*) -> channel(HIDDEN)
|
||||||
;
|
;
|
||||||
|
|
||||||
WS
|
WS
|
||||||
|
@ -44,4 +44,9 @@ public class LuaTokenizerTest extends CpdTextComparisonTest {
|
|||||||
public void testRegression() {
|
public void testRegression() {
|
||||||
doTest("luauTypes");
|
doTest("luauTypes");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testComment() {
|
||||||
|
doTest("comment");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user