diff --git a/src/OneScript.Language/SyntaxAnalysis/DefaultBslParser.cs b/src/OneScript.Language/SyntaxAnalysis/DefaultBslParser.cs index 28ed3f149..75ac1439d 100644 --- a/src/OneScript.Language/SyntaxAnalysis/DefaultBslParser.cs +++ b/src/OneScript.Language/SyntaxAnalysis/DefaultBslParser.cs @@ -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; } }