mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 10:39:39 +02:00
* procvar parsing updated just like psub.pas routine
This commit is contained in:
parent
65d1ea7ff5
commit
c65b618cfb
@ -1523,52 +1523,64 @@ unit pdecl;
|
|||||||
consume(LKLAMMER);
|
consume(LKLAMMER);
|
||||||
inc(testcurobject);
|
inc(testcurobject);
|
||||||
repeat
|
repeat
|
||||||
if token=_VAR then
|
case token of
|
||||||
|
_VAR :
|
||||||
begin
|
begin
|
||||||
consume(_VAR);
|
consume(_VAR);
|
||||||
varspez:=vs_var;
|
varspez:=vs_var;
|
||||||
end
|
end;
|
||||||
else if token=_CONST then
|
_CONST :
|
||||||
begin
|
begin
|
||||||
consume(_CONST);
|
consume(_CONST);
|
||||||
varspez:=vs_const;
|
varspez:=vs_const;
|
||||||
end
|
end;
|
||||||
else varspez:=vs_value;
|
else
|
||||||
|
varspez:=vs_value;
|
||||||
|
end;
|
||||||
|
|
||||||
sc:=idlist;
|
sc:=idlist;
|
||||||
if token=COLON then
|
if (token=COLON) or (varspez=vs_value) then
|
||||||
begin
|
begin
|
||||||
consume(COLON);
|
consume(COLON);
|
||||||
if token=_ARRAY then
|
if token=_ARRAY then
|
||||||
begin
|
begin
|
||||||
{
|
|
||||||
if (varspez<>vs_const) and
|
|
||||||
(varspez<>vs_var) then
|
|
||||||
begin
|
|
||||||
varspez:=vs_const;
|
|
||||||
Message(parser_e_illegal_open_parameter);
|
|
||||||
end;
|
|
||||||
}
|
|
||||||
consume(_ARRAY);
|
consume(_ARRAY);
|
||||||
consume(_OF);
|
consume(_OF);
|
||||||
{ define range and type of range }
|
{ define range and type of range }
|
||||||
p:=new(parraydef,init(0,-1,s32bitdef));
|
p:=new(Parraydef,init(0,-1,s32bitdef));
|
||||||
|
{ array of const ? }
|
||||||
|
if (token=_CONST) and (m_objpas in aktmodeswitches) then
|
||||||
|
begin
|
||||||
|
consume(_CONST);
|
||||||
|
srsym:=nil;
|
||||||
|
if assigned(objpasunit) then
|
||||||
|
getsymonlyin(objpasunit,'TVARREC');
|
||||||
|
if not assigned(srsym) then
|
||||||
|
InternalError(1234124);
|
||||||
|
Parraydef(p)^.definition:=ptypesym(srsym)^.definition;
|
||||||
|
Parraydef(p)^.IsArrayOfConst:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
{ define field type }
|
{ define field type }
|
||||||
parraydef(p)^.definition:=single_type(s);
|
Parraydef(p)^.definition:=single_type(s);
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
p:=single_type(s);
|
p:=single_type(s);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
p:=new(pformaldef,init);
|
p:=new(pformaldef,init);
|
||||||
s:=sc^.get;
|
while not sc^.empty do
|
||||||
while s<>'' do
|
|
||||||
begin
|
begin
|
||||||
procvardef^.concatdef(p,varspez);
|
|
||||||
s:=sc^.get;
|
s:=sc^.get;
|
||||||
|
procvardef^.concatdef(p,varspez);
|
||||||
end;
|
end;
|
||||||
dispose(sc,done);
|
dispose(sc,done);
|
||||||
if token=SEMICOLON then consume(SEMICOLON)
|
if token=SEMICOLON then
|
||||||
else break;
|
consume(SEMICOLON)
|
||||||
|
else
|
||||||
|
break;
|
||||||
until false;
|
until false;
|
||||||
dec(testcurobject);
|
dec(testcurobject);
|
||||||
consume(RKLAMMER);
|
consume(RKLAMMER);
|
||||||
@ -2070,7 +2082,10 @@ unit pdecl;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.75 1998-10-21 08:39:59 florian
|
Revision 1.76 1998-10-25 23:31:18 peter
|
||||||
|
* procvar parsing updated just like psub.pas routine
|
||||||
|
|
||||||
|
Revision 1.75 1998/10/21 08:39:59 florian
|
||||||
+ ansistring operator +
|
+ ansistring operator +
|
||||||
+ $h and string[n] for n>255 added
|
+ $h and string[n] for n>255 added
|
||||||
* small problem with TP fixed
|
* small problem with TP fixed
|
||||||
|
Loading…
Reference in New Issue
Block a user