Skip to content

Commit e646fd5

Browse files
Add multi-line comments in lexer;
1 parent 668c6f7 commit e646fd5

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

XtractQuery/Logic.Domain.CodeAnalysis/Logic.Domain.CodeAnalysis/Level5/Level5ScriptLexer.cs

+22-6
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,32 @@ private Level5SyntaxToken ReadTriviaAndComments()
255255
switch (character)
256256
{
257257
case '/':
258-
if (!IsPeekedChar(1, '/'))
259-
break;
258+
if (IsPeekedChar(1, '/'))
259+
{
260+
_sb.Append(ReadChar());
261+
_sb.Append(ReadChar());
260262

261-
_sb.Append(ReadChar());
262-
_sb.Append(ReadChar());
263+
while (!IsPeekedChar('\n'))
264+
_sb.Append(ReadChar());
263265

264-
while (!IsPeekedChar('\n'))
266+
continue;
267+
}
268+
269+
if (IsPeekedChar(1, '*'))
270+
{
271+
_sb.Append(ReadChar());
265272
_sb.Append(ReadChar());
266273

267-
continue;
274+
while (!IsPeekedChar('*') || !IsPeekedChar(1, '/'))
275+
_sb.Append(ReadChar());
276+
277+
_sb.Append(ReadChar());
278+
_sb.Append(ReadChar());
279+
280+
continue;
281+
}
282+
283+
break;
268284

269285
case ' ':
270286
case '\t':

0 commit comments

Comments
 (0)