From 047423ae48f4a32adc14395133badb948b19ec4a Mon Sep 17 00:00:00 2001 From: Mr-Rm Date: Fri, 11 Oct 2024 14:33:54 +0400 Subject: [PATCH] =?UTF-8?q?fix=20#1459:=20=D0=B4=D0=B8=D0=B0=D0=B3=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=D0=BA=D0=B0=20=D0=B8=D1=81=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B2?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BD=D0=BD=D0=BE=D0=B9=20=D1=84?= =?UTF-8?q?=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D0=BA=D0=B0=D0=BA=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=B4=D1=83=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SyntaxAnalysis/DefaultBslParser.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; } }