Skip to content

Commit 65a8d40

Browse files
committed
уточнение места ошибки препроцессора
1 parent 9217227 commit 65a8d40

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/OneScript.Language/ScriptException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public override string Message
9898
{
9999
var sb = new StringBuilder(MessageWithoutCodeFragment);
100100
sb.AppendLine();
101-
sb.AppendLine(Code.Replace('\t', ' ').TrimEnd());
101+
sb.AppendLine(Code?.Replace('\t', ' ').TrimEnd());
102102

103103
if (ColumnNumber != ErrorPositionInfo.OUT_OF_TEXT)
104104
{

src/OneScript.Language/SyntaxAnalysis/ModuleAnnotationDirectiveHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public sealed override bool HandleDirective(ref Lexem lastExtractedLexem, ILexer
4141

4242
if (!_enabled)
4343
{
44-
ErrorSink.AddError(LocalizedErrors.DirectiveNotSupported(lastExtractedLexem.Content));
44+
var err = LocalizedErrors.DirectiveNotSupported(lastExtractedLexem.Content);
45+
err.Position = lexer.GetErrorPosition();
46+
ErrorSink.AddError(err);
4547
return true;
4648
}
4749

0 commit comments

Comments
 (0)