Skip to content

Commit ae53749

Browse files
committed
Разрешены комментарии после аннотаций модуля
1 parent 6d0eb1a commit ae53749

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/OneScript.Language/SyntaxAnalysis/SingleWordModuleAnnotationHandler.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ public class SingleWordModuleAnnotationHandler : ModuleAnnotationDirectiveHandle
2424
public SingleWordModuleAnnotationHandler(ISet<string> knownNames, IErrorSink errorSink) : base(errorSink)
2525
{
2626
var builder = new LexerBuilder();
27-
builder.Detect((cs, i) => !char.IsWhiteSpace(cs))
28-
.HandleWith(new WordLexerState());
27+
builder
28+
.DetectComments()
29+
.Detect((cs, i) => !char.IsWhiteSpace(cs))
30+
.HandleWith(new WordLexerState());
2931

3032
_allLineContentLexer = builder.Build();
3133
_knownNames = knownNames;
@@ -61,7 +63,7 @@ protected override void ParseAnnotationInternal(ref Lexem lastExtractedLexem, IL
6163
// после ничего не должно находиться
6264
var nextLexem = _allLineContentLexer.NextLexemOnSameLine();
6365
lastExtractedLexem = lexer.NextLexem(); // сдвиг основного лексера
64-
if (nextLexem.Type != LexemType.EndOfText)
66+
if (nextLexem.Type != LexemType.EndOfText && nextLexem.Type != LexemType.Comment)
6567
{
6668
var err = LocalizedErrors.ExpressionSyntax();
6769
err.Position = new ErrorPositionInfo

0 commit comments

Comments
 (0)