mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 12:39:25 +02:00
pas2js: bool switches $hints, $notes, $warnings
git-svn-id: trunk@37823 -
This commit is contained in:
parent
5a5eb66545
commit
df5a9333a7
@ -2518,10 +2518,15 @@ End.
|
||||
<li>{$modeswitch externalclass}: allow declaring external classes</li>
|
||||
<li>{$macro on|off} enables macro replacements. Only macros with a custom value are replaced. Macros are never replaced inside directives.</li>
|
||||
<li>{$I filename} or {$include filename} - insert include file</li>
|
||||
<li>{$ERROR text}</li>
|
||||
<li>{$WARNING text}</li>
|
||||
<li>{$NOTE text}</li>
|
||||
<li>{$HINT text}</li>
|
||||
<li>{$Warnings on|off}</li>
|
||||
<li>{$Notes on|off}</li>
|
||||
<li>{$Hints on|off}</li>
|
||||
<li>{$Error text}</li>
|
||||
<li>{$Warning text}</li>
|
||||
<li>{$Note text}</li>
|
||||
<li>{$Hint text}</li>
|
||||
<li>{$Message hint-text}</li>
|
||||
<li>{$Message hint|note|warn|error|fatal text}</li>
|
||||
<li>{$M+}, {$TypeInfo on}: switches default visibility for class members from public to published</li>
|
||||
<li>{$ScopedEnums on|off} disabled/default: propagate enums to global scope, enable: needs fqn e.g. TEnumType.EnumValue.</li>
|
||||
</ul>
|
||||
|
@ -684,6 +684,7 @@ var
|
||||
aUnitName: String;
|
||||
i: Integer;
|
||||
M: TMacroDef;
|
||||
bs: TBoolSwitches;
|
||||
begin
|
||||
FFileResolver:=aFileResolver;
|
||||
// scanner
|
||||
@ -696,10 +697,18 @@ begin
|
||||
FParser := TPas2jsPasParser.Create(Scanner, FileResolver, PascalResolver);
|
||||
|
||||
// set options
|
||||
Scanner.Options:=Scanner.Options+[po_StopOnErrorDirective];
|
||||
Scanner.AllowedModeSwitches:=msAllPas2jsModeSwitches;
|
||||
Scanner.ReadOnlyModeSwitches:=msAllPas2jsModeSwitchesReadOnly;
|
||||
Scanner.CurrentModeSwitches:=p2jsMode_SwitchSets[Compiler.Mode];
|
||||
Scanner.AllowedBoolSwitches:=msAllPas2jsBoolSwitches;
|
||||
bs:=msAllPas2jsBoolSwitches;
|
||||
if not (coShowHints in Compiler.Options) then
|
||||
Exclude(bs,bsHints);
|
||||
if not (coShowNotes in Compiler.Options) then
|
||||
Exclude(bs,bsNotes);
|
||||
if not (coShowWarnings in Compiler.Options) then
|
||||
Exclude(bs,bsWarnings);
|
||||
Scanner.AllowedBoolSwitches:=bs;
|
||||
// Note: some Scanner.Options are set by TPasResolver
|
||||
for i:=0 to Compiler.Defines.Count-1 do
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user