mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 13:20:21 +02:00
codetools: pas2js: added jsvalue to predefined words
git-svn-id: trunk@54507 -
This commit is contained in:
parent
7547019d49
commit
2c17cc7edf
@ -333,7 +333,7 @@ const
|
|||||||
xtAllPointerTypes = [xtPointer, xtNil];
|
xtAllPointerTypes = [xtPointer, xtNil];
|
||||||
xtAllTypeHelperTypes = xtAllPredefinedTypes-[xtCompilerFunc,xtVariant,xtJSValue,xtNil];
|
xtAllTypeHelperTypes = xtAllPredefinedTypes-[xtCompilerFunc,xtVariant,xtJSValue,xtNil];
|
||||||
|
|
||||||
xtAllStringCompatibleTypes = xtAllStringTypes+[xtChar];
|
xtAllStringCompatibleTypes = xtAllStringTypes+[xtChar,xtJSValue];
|
||||||
xtAllWideStringCompatibleTypes = xtAllWideStringTypes+[xtWideChar,xtChar];
|
xtAllWideStringCompatibleTypes = xtAllWideStringTypes+[xtWideChar,xtChar];
|
||||||
|
|
||||||
xtAllIntegerConvertibles = xtAllIntegerTypes;
|
xtAllIntegerConvertibles = xtAllIntegerTypes;
|
||||||
@ -8362,6 +8362,7 @@ begin
|
|||||||
// -> setup compiler dependent tables
|
// -> setup compiler dependent tables
|
||||||
case Scanner.PascalCompiler of
|
case Scanner.PascalCompiler of
|
||||||
pcDelphi: WordIsPredefinedIdentifier:=WordIsPredefinedDelphiIdentifier;
|
pcDelphi: WordIsPredefinedIdentifier:=WordIsPredefinedDelphiIdentifier;
|
||||||
|
pcPas2js: WordIsPredefinedIdentifier:=WordIsPredefinedPas2jsIdentifier;
|
||||||
else
|
else
|
||||||
WordIsPredefinedIdentifier:=WordIsPredefinedFPCIdentifier;
|
WordIsPredefinedIdentifier:=WordIsPredefinedFPCIdentifier;
|
||||||
end;
|
end;
|
||||||
@ -11141,6 +11142,7 @@ begin
|
|||||||
and (ExpressionType.Desc in xtAllBooleanConvertibles))
|
and (ExpressionType.Desc in xtAllBooleanConvertibles))
|
||||||
or ((TargetType.Desc in xtAllPointerTypes)
|
or ((TargetType.Desc in xtAllPointerTypes)
|
||||||
and (ExpressionType.Desc in xtAllPointerConvertibles))
|
and (ExpressionType.Desc in xtAllPointerConvertibles))
|
||||||
|
or (TargetType.Desc=xtJSValue)
|
||||||
then
|
then
|
||||||
Result:=tcCompatible
|
Result:=tcCompatible
|
||||||
else if (TargetType.Desc=xtContext) then begin
|
else if (TargetType.Desc=xtContext) then begin
|
||||||
@ -12920,6 +12922,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
xtConstBoolean:
|
xtConstBoolean:
|
||||||
Result:=ExpressionTypeDescNames[xtBoolean];
|
Result:=ExpressionTypeDescNames[xtBoolean];
|
||||||
|
xtJSValue:
|
||||||
|
Result:=ExpressionTypeDescNames[ExprType.Desc];
|
||||||
xtNil:
|
xtNil:
|
||||||
RaiseTermNotSimple;
|
RaiseTermNotSimple;
|
||||||
else
|
else
|
||||||
|
@ -155,6 +155,7 @@ var
|
|||||||
WordIsCustomOperator,
|
WordIsCustomOperator,
|
||||||
WordIsPredefinedFPCIdentifier,
|
WordIsPredefinedFPCIdentifier,
|
||||||
WordIsPredefinedDelphiIdentifier,
|
WordIsPredefinedDelphiIdentifier,
|
||||||
|
WordIsPredefinedPas2jsIdentifier,
|
||||||
UnexpectedKeyWordInBeginBlock,
|
UnexpectedKeyWordInBeginBlock,
|
||||||
UnexpectedKeyWordInAsmBlock,
|
UnexpectedKeyWordInAsmBlock,
|
||||||
UnexpectedKeyWordInAsmPas2JSBlock,
|
UnexpectedKeyWordInAsmPas2JSBlock,
|
||||||
@ -1779,6 +1780,32 @@ begin
|
|||||||
Add('CONTINUE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
Add('CONTINUE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
Add('PCHAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
Add('PCHAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
WordIsPredefinedPas2jsIdentifier:=TKeyWordFunctionList.Create('WordIsPredefinedPas2jsIdentifier');
|
||||||
|
KeyWordLists.Add(WordIsPredefinedPas2jsIdentifier);
|
||||||
|
with WordIsPredefinedPas2jsIdentifier do begin
|
||||||
|
Add('BOOLEAN' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('WORDBOOL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('CHAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('DOUBLE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('FALSE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('HIGH' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('INT64' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('LONGINT' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('LENGTH' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('LOW' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('NIL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('ORD' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('PRED' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('SINGLE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('STRING' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('SUCC' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('TRUE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('EXIT' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('BREAK' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('CONTINUE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('JSVALUE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure InternalFinal;
|
procedure InternalFinal;
|
||||||
|
Loading…
Reference in New Issue
Block a user