summaryrefslogtreecommitdiff
path: root/packages/fcl-passrc
diff options
context:
space:
mode:
authormattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-10-13 20:56:48 +0000
committermattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-10-13 20:56:48 +0000
commitfdbb8fc62d406723b7a641b6c32bba0febda5d67 (patch)
tree1f3b1476c341a4424a4d39286553b23bdb00ee87 /packages/fcl-passrc
parentb441bebedf699f229956597a2403c52b94abf220 (diff)
downloadfpc-fdbb8fc62d406723b7a641b6c32bba0febda5d67.tar.gz
fcl-passrc: resolver: if then <empty> else ;
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@39928 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-passrc')
-rw-r--r--packages/fcl-passrc/src/pasresolver.pp1
-rw-r--r--packages/fcl-passrc/tests/tcresolver.pas12
2 files changed, 13 insertions, 0 deletions
diff --git a/packages/fcl-passrc/src/pasresolver.pp b/packages/fcl-passrc/src/pasresolver.pp
index 1c8b4e2c46..e90a84b3f2 100644
--- a/packages/fcl-passrc/src/pasresolver.pp
+++ b/packages/fcl-passrc/src/pasresolver.pp
@@ -13882,6 +13882,7 @@ begin
AddInitialFinalizationSection(TFinalizationSection(El))
else if AClass.InheritsFrom(TPasImplBlock) then
// resolved when finished
+ else if AClass=TPasImplCommand then
else if AClass=TPasUnresolvedUnitRef then
RaiseMsg(20171018121900,nCantFindUnitX,sCantFindUnitX,[AName],El)
else
diff --git a/packages/fcl-passrc/tests/tcresolver.pas b/packages/fcl-passrc/tests/tcresolver.pas
index d7e3591bd8..436d12ed81 100644
--- a/packages/fcl-passrc/tests/tcresolver.pas
+++ b/packages/fcl-passrc/tests/tcresolver.pas
@@ -340,6 +340,7 @@ type
Procedure TestStatementsRefs;
Procedure TestRepeatUntilNonBoolFail;
Procedure TestWhileDoNonBoolFail;
+ Procedure TestIfThen;
Procedure TestIfThenNonBoolFail;
Procedure TestIfAssignMissingSemicolonFail;
Procedure TestForLoopVarNonVarFail;
@@ -5082,6 +5083,17 @@ begin
CheckResolverException('Boolean expected, but Longint found',nXExpectedButYFound);
end;
+procedure TTestResolver.TestIfThen;
+begin
+ StartProgram(false);
+ Add([
+ 'var b: boolean;',
+ 'begin',
+ ' if b then ;',
+ ' if b then else ;']);
+ ParseProgram;
+end;
+
procedure TTestResolver.TestIfThenNonBoolFail;
begin
StartProgram(false);