mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 19:59:18 +02:00
pastojs: ord(integer)
git-svn-id: trunk@48237 -
This commit is contained in:
parent
af5a6cd9d2
commit
c32ef4af38
@ -13399,6 +13399,15 @@ begin
|
||||
Result:=Add;
|
||||
exit;
|
||||
end
|
||||
else if bt in btAllJSInteger then
|
||||
begin
|
||||
// ord(integer)
|
||||
Result:=CheckOrdConstant(aResolver,Param);
|
||||
if Result<>nil then exit;
|
||||
// ord(integer) -> integer
|
||||
Result:=ConvertExpression(Param,AContext);
|
||||
exit;
|
||||
end
|
||||
else if bt=btContext then
|
||||
begin
|
||||
C:=ParamResolved.LoTypeEl.ClassType;
|
||||
|
@ -7182,7 +7182,9 @@ begin
|
||||
'begin',
|
||||
' i:=i2;',
|
||||
' i:=default(TMyInt);',
|
||||
' if i=i2 then ;']);
|
||||
' if i=i2 then ;',
|
||||
' i:=ord(i2);',
|
||||
'']);
|
||||
ConvertProgram;
|
||||
CheckSource('TestIntegerRange',
|
||||
LinesToStr([
|
||||
@ -7203,6 +7205,7 @@ begin
|
||||
'$mod.i = $mod.i2;',
|
||||
'$mod.i = -1;',
|
||||
'if ($mod.i === $mod.i2) ;',
|
||||
'$mod.i = $mod.i2;',
|
||||
'']));
|
||||
end;
|
||||
|
||||
@ -7317,6 +7320,7 @@ begin
|
||||
' i:=system.high(i);',
|
||||
' i:=system.pred(i);',
|
||||
' i:=system.succ(i);',
|
||||
' i:=system.ord(i);',
|
||||
'']);
|
||||
ConvertProgram;
|
||||
CheckResolverUnexpectedHints;
|
||||
@ -7333,6 +7337,7 @@ begin
|
||||
'$mod.i = 255;',
|
||||
'$mod.i = $mod.i - 1;',
|
||||
'$mod.i = $mod.i + 1;',
|
||||
'$mod.i = $mod.i;',
|
||||
'']));
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user