@@ -346,18 +346,14 @@ void preprocessorDirectives() {
346346
347347 var decoded = getDecodedTokens (bsl );
348348
349- // Verify preprocessor macro tokens on specific lines
349+ // Verify preprocessor macro tokens - # and keyword are combined into single token
350350 var expectedTokens = List .of (
351- new ExpectedToken (0 , 0 , 1 , SemanticTokenTypes .Macro , "#" ),
352- new ExpectedToken (0 , 1 , 4 , SemanticTokenTypes .Macro , "Если" ),
351+ new ExpectedToken (0 , 0 , 5 , SemanticTokenTypes .Macro , "#Если" ),
353352 new ExpectedToken (0 , 6 , 6 , SemanticTokenTypes .Macro , "Сервер" ),
354353 new ExpectedToken (0 , 13 , 5 , SemanticTokenTypes .Macro , "Тогда" ),
355- new ExpectedToken (3 , 0 , 1 , SemanticTokenTypes .Macro , "#" ),
356- new ExpectedToken (3 , 1 , 9 , SemanticTokenTypes .Macro , "ИначеЕсли" ),
357- new ExpectedToken (4 , 0 , 1 , SemanticTokenTypes .Macro , "#" ),
358- new ExpectedToken (4 , 1 , 5 , SemanticTokenTypes .Macro , "Иначе" ),
359- new ExpectedToken (5 , 0 , 1 , SemanticTokenTypes .Macro , "#" ),
360- new ExpectedToken (5 , 1 , 9 , SemanticTokenTypes .Macro , "КонецЕсли" )
354+ new ExpectedToken (3 , 0 , 10 , SemanticTokenTypes .Macro , "#ИначеЕсли" ),
355+ new ExpectedToken (4 , 0 , 6 , SemanticTokenTypes .Macro , "#Иначе" ),
356+ new ExpectedToken (5 , 0 , 10 , SemanticTokenTypes .Macro , "#КонецЕсли" )
361357 );
362358
363359 assertContainsTokens (decoded , expectedTokens );
@@ -391,6 +387,8 @@ void literals() {
391387 @ Test
392388 void methodDescriptionComments () {
393389 String bsl = """
390+ // просто коммент
391+
394392 // Описание процедуры
395393 // Параметры:
396394 // Парам - Число - описание
@@ -402,41 +400,43 @@ void methodDescriptionComments() {
402400 var decoded = getDecodedTokens (bsl );
403401
404402 // Documentation comments are now split around BSL doc keywords and operators.
405- // Line 0 : "// Описание процедуры" - no BSL doc elements, full line as Comment+Documentation
406- // Line 1 : "// Параметры:" - keyword in structural position
407- // Line 2 : "// Парам - Число - описание" - parameter name, type, operator, description
403+ // Line 3 : "// Описание процедуры" - no BSL doc elements, full line as Comment+Documentation
404+ // Line 4 : "// Параметры:" - keyword in structural position
405+ // Line 4 : "// Парам - Число - описание" - parameter name, type, operator, description
408406 // Body comment on line 4 should NOT have Documentation modifier
409407 var expected = List .of (
410- // Line 0: full line as Comment+Documentation
411- new ExpectedToken (0 , 0 , 21 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , "// Описание процедуры" ),
412- // Line 1: "// " before keyword
413- new ExpectedToken (1 , 0 , 3 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , "// " ),
414- // Line 1: "Параметры:" keyword
415- new ExpectedToken (1 , 3 , 10 , SemanticTokenTypes .Macro , SemanticTokenModifiers .Documentation , "Параметры:" ),
416- // Line 2: "// " before param name
417- new ExpectedToken (2 , 0 , 4 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , "// " ),
418- // Line 2: "Парам" parameter name
419- new ExpectedToken (2 , 4 , 5 , SemanticTokenTypes .Parameter , SemanticTokenModifiers .Documentation , "Парам" ),
420- // Line 2: " " between param name and dash
421- new ExpectedToken (2 , 9 , 3 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , " - " ),
422- // Line 2: "Число" type
423- new ExpectedToken (2 , 12 , 5 , SemanticTokenTypes .Type , SemanticTokenModifiers .Documentation , "Число" ),
424- // Line 2: " " between type and second dash
425- new ExpectedToken (2 , 17 , 11 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , " - описание" ),
426- // Line 3: Процедура keyword
427- new ExpectedToken (3 , 0 , 9 , SemanticTokenTypes .Keyword , "Процедура" ),
428- // Line 3: ДокТест method name
429- new ExpectedToken (3 , 10 , 7 , SemanticTokenTypes .Method , "ДокТест" ),
430- // Line 3: ( operator
431- new ExpectedToken (3 , 17 , 1 , SemanticTokenTypes .Operator , "(" ),
432- // Line 3: Парам parameter definition
433- new ExpectedToken (3 , 18 , 5 , SemanticTokenTypes .Parameter , SemanticTokenModifiers .Definition , "Парам" ),
434- // Line 3: ) operator
435- new ExpectedToken (3 , 23 , 1 , SemanticTokenTypes .Operator , ")" ),
436- // Line 4: body comment (no Documentation modifier)
437- new ExpectedToken (4 , 2 , 22 , SemanticTokenTypes .Comment , "// обычный комментарий" ),
438- // Line 5: КонецПроцедуры keyword
439- new ExpectedToken (5 , 0 , 14 , SemanticTokenTypes .Keyword , "КонецПроцедуры" )
408+ new ExpectedToken (0 , 0 , 17 , SemanticTokenTypes .Comment , "// просто коммент" ),
409+
410+ // Line 2: full line as Comment+Documentation
411+ new ExpectedToken (2 , 0 , 21 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , "// Описание процедуры" ),
412+ // Line 3: "// " before keyword
413+ new ExpectedToken (3 , 0 , 3 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , "// " ),
414+ // Line 3: "Параметры:" keyword
415+ new ExpectedToken (3 , 3 , 10 , SemanticTokenTypes .Macro , SemanticTokenModifiers .Documentation , "Параметры:" ),
416+ // Line 4: "// " before param name
417+ new ExpectedToken (4 , 0 , 4 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , "// " ),
418+ // Line 4: "Парам" parameter name
419+ new ExpectedToken (4 , 4 , 5 , SemanticTokenTypes .Parameter , SemanticTokenModifiers .Documentation , "Парам" ),
420+ // Line 4: " " between param name and dash
421+ new ExpectedToken (4 , 9 , 3 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , " - " ),
422+ // Line 4: "Число" type
423+ new ExpectedToken (4 , 12 , 5 , SemanticTokenTypes .Type , SemanticTokenModifiers .Documentation , "Число" ),
424+ // Line 4: " " between type and second dash
425+ new ExpectedToken (4 , 17 , 11 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , " - описание" ),
426+ // Line 5: Процедура keyword
427+ new ExpectedToken (5 , 0 , 9 , SemanticTokenTypes .Keyword , "Процедура" ),
428+ // Line 5: ДокТест method name
429+ new ExpectedToken (5 , 10 , 7 , SemanticTokenTypes .Method , "ДокТест" ),
430+ // Line 5: ( operator
431+ new ExpectedToken (5 , 17 , 1 , SemanticTokenTypes .Operator , "(" ),
432+ // Line 5: Парам parameter definition
433+ new ExpectedToken (5 , 18 , 5 , SemanticTokenTypes .Parameter , SemanticTokenModifiers .Definition , "Парам" ),
434+ // Line 5: ) operator
435+ new ExpectedToken (5 , 23 , 1 , SemanticTokenTypes .Operator , ")" ),
436+ // Line 6: body comment (no Documentation modifier)
437+ new ExpectedToken (6 , 2 , 22 , SemanticTokenTypes .Comment , "// обычный комментарий" ),
438+ // Line 7: КонецПроцедуры keyword
439+ new ExpectedToken (7 , 0 , 14 , SemanticTokenTypes .Keyword , "КонецПроцедуры" )
440440 );
441441
442442 assertTokensMatch (decoded , expected );
@@ -465,7 +465,6 @@ void variableDescriptionComments() {
465465 new ExpectedToken (1 , 14 , 8 , SemanticTokenTypes .Comment , SemanticTokenModifiers .Documentation , "// трейл" )
466466 );
467467
468-
469468 assertTokensMatch (decoded , expected );
470469 }
471470
0 commit comments