Skip to content

Commit

Permalink
fix EvilBeaver#1459: диагностика использования встроенной функции как…
Browse files Browse the repository at this point in the history
… процедуры
  • Loading branch information
Mr-Rm committed Oct 21, 2024
1 parent 44709af commit 047423a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/OneScript.Language/SyntaxAnalysis/DefaultBslParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,15 @@ private void BuildComplexStructureStatement()
BuildGotoOperator();
break;
default:
var expected = _tokenStack.Peek();
AddError(LocalizedErrors.TokenExpected(expected));
if (LanguageDef.IsBuiltInFunction(_lastExtractedLexem.Token))
{
AddError(LocalizedErrors.UseBuiltInFunctionAsProcedure());
}
else
{
var expected = _tokenStack.Peek();
AddError(LocalizedErrors.TokenExpected(expected));
}
break;
}
}
Expand Down

0 comments on commit 047423a

Please sign in to comment.