From 02393dbf786ada4cbfc97e8dee3d32d3307d351a Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 23 Aug 2020 10:34:08 +0000 Subject: [PATCH] * Merging revisions r45395 from trunk: ------------------------------------------------------------------------ r45395 | michael | 2020-05-17 09:54:41 +0200 (Sun, 17 May 2020) | 1 line * Add switch to ignore unknown resources ------------------------------------------------------------------------ git-svn-id: branches/fixes_3_2@46644 - --- packages/fcl-passrc/src/pscanner.pp | 9 +++++++-- packages/pastojs/src/pas2jsfiler.pp | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/fcl-passrc/src/pscanner.pp b/packages/fcl-passrc/src/pscanner.pp index c9242d8edb..c5a76477d0 100644 --- a/packages/fcl-passrc/src/pscanner.pp +++ b/packages/fcl-passrc/src/pscanner.pp @@ -665,7 +665,8 @@ type po_CheckCondFunction, // error on unknown function in conditional expression, default: return '0' po_StopOnErrorDirective, // error on user $Error, $message error|fatal po_ExtConstWithoutExpr, // allow typed const without expression in external class and with external modifier - po_StopOnUnitInterface // parse only a unit name and stop at interface keyword + po_StopOnUnitInterface, // parse only a unit name and stop at interface keyword + po_IgnoreUnknownResource // Ignore resources for which no handler is registered. ); TPOptions = set of TPOption; @@ -3374,7 +3375,11 @@ begin if (H=Nil) then H:=FindResourceHandler('*'); if (H=Nil) then - Error(nNoResourceSupport,SNoResourceSupport,[Ext]); + begin + if not (po_IgnoreUnknownResource in Options) then + Error(nNoResourceSupport,SNoResourceSupport,[Ext]); + exit; + end; // Let the handler take care of the rest. OptList:=TStringList.Create; try diff --git a/packages/pastojs/src/pas2jsfiler.pp b/packages/pastojs/src/pas2jsfiler.pp index 14748b4911..621f659a41 100644 --- a/packages/pastojs/src/pas2jsfiler.pp +++ b/packages/pastojs/src/pas2jsfiler.pp @@ -106,7 +106,8 @@ const 'CheckCondFunction', 'StopOnErrorDirective', 'ExtClassConstWithoutExpr', - 'StopOnUnitInterface'); + 'StopOnUnitInterface', + 'IgnoreUnknownResource'); PCUDefaultModeSwitches: TModeSwitches = [ msObjfpc,