fcl-passrc, pastojs: renamed modeswitch multiplescopehelpers to multihelpers

This commit is contained in:
mattias 2019-02-26 08:36:56 +00:00
parent b58d2cdcac
commit 557d181ec9
6 changed files with 14 additions and 10 deletions

View File

@ -16897,7 +16897,7 @@ begin
Scope.Add(HelperScope); Scope.Add(HelperScope);
HelperScope:=HelperScope.AncestorScope; HelperScope:=HelperScope.AncestorScope;
end; end;
if not (msMultipleScopeHelpers in CurrentParser.CurrentModeswitches) then if not (msMultiHelpers in CurrentParser.CurrentModeswitches) then
break; break;
end; end;
end; end;

View File

@ -295,7 +295,7 @@ type
msPrefixedAttributes, { Allow attributes, disable proc modifier [] } msPrefixedAttributes, { Allow attributes, disable proc modifier [] }
msIgnoreAttributes, { workaround til resolver/converter supports attributes } msIgnoreAttributes, { workaround til resolver/converter supports attributes }
msOmitRTTI, { treat class section 'published' as 'public' and typeinfo does not work on symbols declared with this switch } msOmitRTTI, { treat class section 'published' as 'public' and typeinfo does not work on symbols declared with this switch }
msMultipleScopeHelpers { off=only one helper per type, on=all } msMultiHelpers { off=only one helper per type, on=all }
); );
TModeSwitches = Set of TModeSwitch; TModeSwitches = Set of TModeSwitch;
@ -1040,7 +1040,7 @@ const
'PREFIXEDATTRIBUTES', 'PREFIXEDATTRIBUTES',
'IGNOREATTRIBUTES', 'IGNOREATTRIBUTES',
'OMITRTTI', 'OMITRTTI',
'MULTIPLESCOPEHELPERS' 'MULTIHELPERS'
); );
LetterSwitchNames: array['A'..'Z'] of string=( LetterSwitchNames: array['A'..'Z'] of string=(

View File

@ -907,7 +907,7 @@ type
Procedure TestClassHelper_ReintroduceHides_CallFail; Procedure TestClassHelper_ReintroduceHides_CallFail;
Procedure TestClassHelper_DefaultProperty; Procedure TestClassHelper_DefaultProperty;
Procedure TestClassHelper_DefaultClassProperty; Procedure TestClassHelper_DefaultClassProperty;
Procedure TestClassHelper_MultipleScopeHelpers; Procedure TestClassHelper_MultiHelpers;
Procedure TestRecordHelper; Procedure TestRecordHelper;
Procedure TestRecordHelper_ForByteFail; Procedure TestRecordHelper_ForByteFail;
Procedure TestRecordHelper_ClassNonStaticFail; Procedure TestRecordHelper_ClassNonStaticFail;
@ -16764,11 +16764,11 @@ begin
ParseProgram; ParseProgram;
end; end;
procedure TTestResolver.TestClassHelper_MultipleScopeHelpers; procedure TTestResolver.TestClassHelper_MultiHelpers;
begin begin
StartProgram(false); StartProgram(false);
Add([ Add([
'{$modeswitch multiplescopehelpers}', '{$modeswitch multihelpers}',
'type', 'type',
' TObject = class', ' TObject = class',
' end;', ' end;',

View File

@ -1160,7 +1160,7 @@ const
msArrayOperators, msArrayOperators,
msIgnoreAttributes, msIgnoreAttributes,
msOmitRTTI, msOmitRTTI,
msMultipleScopeHelpers]; msMultiHelpers];
msAllPas2jsBoolSwitchesReadOnly = [ msAllPas2jsBoolSwitchesReadOnly = [
bsLongStrings bsLongStrings

View File

@ -170,7 +170,7 @@ const
'PrefixedAttributes', 'PrefixedAttributes',
'IgnoreAttributes', 'IgnoreAttributes',
'OmitRTTI', 'OmitRTTI',
'MultipleScopeHelpers' 'MultiHelpers'
); );
PCUDefaultBoolSwitches: TBoolSwitches = [ PCUDefaultBoolSwitches: TBoolSwitches = [
@ -1385,8 +1385,10 @@ begin
msISOLikeMod: Result:=43; msISOLikeMod: Result:=43;
msExternalClass: Result:=44; msExternalClass: Result:=44;
msPrefixedAttributes: Result:=45; msPrefixedAttributes: Result:=45;
// msIgnoreInterfaces: Result:=46; // was: msIgnoreInterfaces: Result:=46;
msIgnoreAttributes: Result:=47; msIgnoreAttributes: Result:=47;
msOmitRTTI: Result:=48;
msMultiHelpers: Result:=49;
end; end;
end; end;
@ -4892,6 +4894,8 @@ begin
begin begin
s:=Names[i]; s:=Names[i];
Found:=false; Found:=false;
if (FileVersion<5) and (SameText(s,'multiplescopehelpers')) then
s:=PCUModeSwitchNames[msMultiHelpers];
for f in TModeSwitch do for f in TModeSwitch do
if s=PCUModeSwitchNames[f] then if s=PCUModeSwitchNames[f] then
begin begin

View File

@ -1858,7 +1858,7 @@ function(){
If there are multiple helpers for the same type, the last helper in scope wins.<br> If there are multiple helpers for the same type, the last helper in scope wins.<br>
A class with ancestors can have one active helper per ancestor type, so A class with ancestors can have one active helper per ancestor type, so
multiple helpers can be active, same as FPC/Delphi.<br> multiple helpers can be active, same as FPC/Delphi.<br>
Using <b>{$modeswitch multiplescopehelpers}</b> you can activate all helpers Using <b>{$modeswitch multihelpers}</b> you can activate all helpers
within scope. within scope.
</li> </li>
<li>Nested helpers (e.g. <i>TDemo.TSub.THelper</i>) are elevated. <li>Nested helpers (e.g. <i>TDemo.TSub.THelper</i>) are elevated.