codetools: pas2js: use define instead of mode

git-svn-id: trunk@54285 -
This commit is contained in:
mattias 2017-02-26 22:36:39 +00:00
parent 9a663cc51d
commit 8ab48719ee
3 changed files with 6 additions and 13 deletions

View File

@ -157,8 +157,7 @@ type
cmTP,
cmOBJFPC,
cmMacPas,
cmISO,
cmPas2Js
cmISO
);
{ TCompilerModeSwitch - see fpc/compiler/globtype.pas tmodeswitch }
TCompilerModeSwitch = (
@ -230,11 +229,7 @@ const
cmsISOLike_unary_minus,cmsDefault_inline],
// cmISO
[cmsTp_procvar,cmsDuplicate_names,cmsNestedProcVars,cmsNonLocalGoto,
cmsISOLike_unary_minus],
// cmPas2Js
[cmsNested_comment,cmsRepeat_forward,
cmsInitfinal,cmsHintdirective,cmsProperty,cmsDefault_inline,
cmsResult]
cmsISOLike_unary_minus]
);
type
@ -766,8 +761,7 @@ const
'TP',
'OBJFPC',
'MACPAS',
'ISO',
'PAS2JS'
'ISO'
);
// upper case (see fpc/compiler/globtype.pas modeswitchstr )

View File

@ -2858,7 +2858,7 @@ begin
if (Src[CurPos.StartPos-1]='@') then begin
// allow anything behind @
end else if (CurPos.Flag=cafWord) then begin
if Scanner.CompilerMode=cmPas2Js then begin
if Scanner.Values.IsDefined('pas2js') then begin
if UnexpectedKeyWordInAsmPas2JSBlock.DoIdentifier(@Src[CurPos.StartPos]) then
SaveRaiseUnexpectedKeyWordInBeginEndBlock;
end else if UnexpectedKeyWordInAsmBlock.DoIdentifier(@Src[CurPos.StartPos]) then

View File

@ -34,13 +34,12 @@ implementation
const
// CompilerMode names to be shown after -M...
CompilerModesPretty: array[TCompilerMode] of shortstring = (
'fpc', 'Delphi', 'DelphiUnicode', 'gpc', 'tp', 'ObjFPC', 'MacPas', 'iso', 'pas2js'
'fpc', 'Delphi', 'DelphiUnicode', 'gpc', 'tp', 'ObjFPC', 'MacPas', 'iso'
);
// CompilerMode descriptions.
CompilerModesDescr: array[TCompilerMode] of shortstring = (
'Free Pascal', 'Delphi', 'Delphi Unicode', 'GNU Pascal', 'Turbo Pascal',
'Object Pascal', 'Mac Pascal', 'ISO/IEC 7185 Pascal',
'Pas2JS - Pascal to JavaScript transpiler'
'Object Pascal', 'Mac Pascal', 'ISO/IEC 7185 Pascal'
);
function SyntaxModeToCaption(const ModeStr: string): string;