mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:09:32 +02:00
+ support for "return x" as equivalent for "exit(x)" in macpas mode
git-svn-id: trunk@2042 -
This commit is contained in:
parent
9a08cdccf0
commit
5ccbeea1d3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6587,6 +6587,7 @@ tests/webtbs/tw4100.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4104.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4115.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4119.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4136.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4140.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4150.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4151.pp svneol=native#text/plain
|
||||
|
@ -2016,6 +2016,11 @@ implementation
|
||||
end
|
||||
else
|
||||
case token of
|
||||
_RETURN :
|
||||
begin
|
||||
consume(_RETURN);
|
||||
p1 := cexitnode.create(comp_expr(true));
|
||||
end;
|
||||
_INHERITED :
|
||||
begin
|
||||
again:=true;
|
||||
|
@ -167,6 +167,7 @@ type
|
||||
_RECORD,
|
||||
_REPEAT,
|
||||
_RESULT,
|
||||
_RETURN,
|
||||
_STATIC,
|
||||
_STORED,
|
||||
_STRICT,
|
||||
@ -411,6 +412,7 @@ const
|
||||
(str:'RECORD' ;special:false;keyword:m_all;op:NOTOKEN),
|
||||
(str:'REPEAT' ;special:false;keyword:m_all;op:NOTOKEN),
|
||||
(str:'RESULT' ;special:false;keyword:m_none;op:NOTOKEN),
|
||||
(str:'RETURN' ;special:false;keyword:m_mac;op:NOTOKEN),
|
||||
(str:'STATIC' ;special:false;keyword:m_none;op:NOTOKEN),
|
||||
(str:'STORED' ;special:false;keyword:m_none;op:NOTOKEN),
|
||||
(str:'STRICT' ;special:false;keyword:m_none;op:NOTOKEN),
|
||||
|
11
tests/webtbs/tw4136.pp
Normal file
11
tests/webtbs/tw4136.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{$mode macpas}
|
||||
function f: longint;
|
||||
begin
|
||||
return 3;
|
||||
end;
|
||||
|
||||
begin
|
||||
if f() <> 3 then
|
||||
halt(1);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user