+ support for "return x" as equivalent for "exit(x)" in macpas mode

git-svn-id: trunk@2042 -
This commit is contained in:
Jonas Maebe 2005-12-23 22:49:15 +00:00
parent 9a08cdccf0
commit 5ccbeea1d3
4 changed files with 19 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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;

View File

@ -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
View File

@ -0,0 +1,11 @@
{$mode macpas}
function f: longint;
begin
return 3;
end;
begin
if f() <> 3 then
halt(1);
end.