mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-02-04 08:14:51 +01:00
pastojs: error on var absolute
git-svn-id: trunk@36811 -
This commit is contained in:
parent
e266fd75e0
commit
4a588fcbc2
@ -248,6 +248,7 @@ Works:
|
||||
- dotted unit names, namespaces
|
||||
|
||||
ToDos:
|
||||
- ignore attributes
|
||||
- constant evaluation
|
||||
- static arrays
|
||||
- property index specifier
|
||||
@ -1988,6 +1989,11 @@ var
|
||||
ParentC: TClass;
|
||||
begin
|
||||
inherited FinishVariable(El);
|
||||
|
||||
if El.AbsoluteLocation<>'' then
|
||||
RaiseMsg(20170728133340,nInvalidVariableModifier,
|
||||
sInvalidVariableModifier,['absolute'],El);
|
||||
|
||||
ParentC:=El.Parent.ClassType;
|
||||
if (ParentC=TPasClassType) then
|
||||
begin
|
||||
|
||||
@ -191,6 +191,7 @@ type
|
||||
Procedure TestLocalConst;
|
||||
Procedure TestVarExternal;
|
||||
Procedure TestVarExternalOtherUnit;
|
||||
Procedure TestVarAbsoluteFail;
|
||||
|
||||
// numbers
|
||||
Procedure TestDouble;
|
||||
@ -3743,6 +3744,18 @@ begin
|
||||
'']) );
|
||||
end;
|
||||
|
||||
procedure TTestModule.TestVarAbsoluteFail;
|
||||
begin
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'var',
|
||||
' a: longint;',
|
||||
' b: longword absolute a;',
|
||||
'begin']);
|
||||
SetExpectedPasResolverError('Invalid variable modifier "absolute"',nInvalidVariableModifier);
|
||||
ConvertProgram;
|
||||
end;
|
||||
|
||||
procedure TTestModule.TestDouble;
|
||||
begin
|
||||
StartProgram(false);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user