@@ -23,19 +23,25 @@ public class SingleWordModuleAnnotationHandler : ModuleAnnotationDirectiveHandle
2323
2424 public SingleWordModuleAnnotationHandler ( ISet < string > knownNames , IErrorSink errorSink ) : base ( errorSink )
2525 {
26- var builder = new LexerBuilder ( ) ;
27- builder . Detect ( ( cs , i ) => ! char . IsWhiteSpace ( cs ) )
28- . HandleWith ( new WordLexerState ( ) ) ;
26+ var builder = SetupLexerBuilder ( ) ;
2927
3028 _allLineContentLexer = builder . Build ( ) ;
3129 _knownNames = knownNames ;
3230 }
33-
34- public SingleWordModuleAnnotationHandler ( ISet < BilingualString > knownNames , IErrorSink errorSink ) : base ( errorSink )
31+
32+ private static LexerBuilder SetupLexerBuilder ( )
3533 {
3634 var builder = new LexerBuilder ( ) ;
37- builder . Detect ( ( cs , i ) => ! char . IsWhiteSpace ( cs ) )
35+ builder
36+ . DetectComments ( )
37+ . Detect ( ( cs , i ) => ! char . IsWhiteSpace ( cs ) )
3838 . HandleWith ( new WordLexerState ( ) ) ;
39+ return builder ;
40+ }
41+
42+ public SingleWordModuleAnnotationHandler ( ISet < BilingualString > knownNames , IErrorSink errorSink ) : base ( errorSink )
43+ {
44+ var builder = SetupLexerBuilder ( ) ;
3945
4046 _allLineContentLexer = builder . Build ( ) ;
4147
@@ -61,7 +67,7 @@ protected override void ParseAnnotationInternal(ref Lexem lastExtractedLexem, IL
6167 // после ничего не должно находиться
6268 var nextLexem = _allLineContentLexer . NextLexemOnSameLine ( ) ;
6369 lastExtractedLexem = lexer . NextLexem ( ) ; // сдвиг основного лексера
64- if ( nextLexem . Type != LexemType . EndOfText )
70+ if ( nextLexem . Type != LexemType . EndOfText && nextLexem . Type != LexemType . Comment )
6571 {
6672 var err = LocalizedErrors . ExpressionSyntax ( ) ;
6773 err . Position = new ErrorPositionInfo
0 commit comments