mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 09:30:17 +02:00
* extend scanning of $modeswitch to support not only + and -, but also ON and OFF like other switches
+ added tests git-svn-id: trunk@39280 -
This commit is contained in:
parent
f036e67d8f
commit
ff407c56d9
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -10882,6 +10882,8 @@ tests/tbf/tb0255a.pp svneol=native#text/pascal
|
|||||||
tests/tbf/tb0255b.pp svneol=native#text/pascal
|
tests/tbf/tb0255b.pp svneol=native#text/pascal
|
||||||
tests/tbf/tb0255c.pp svneol=native#text/pascal
|
tests/tbf/tb0255c.pp svneol=native#text/pascal
|
||||||
tests/tbf/tb0256.pp svneol=native#text/pascal
|
tests/tbf/tb0256.pp svneol=native#text/pascal
|
||||||
|
tests/tbf/tb0257a.pp svneol=native#text/pascal
|
||||||
|
tests/tbf/tb0257b.pp svneol=native#text/pascal
|
||||||
tests/tbf/ub0115.pp svneol=native#text/plain
|
tests/tbf/ub0115.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0149.pp svneol=native#text/plain
|
tests/tbf/ub0149.pp svneol=native#text/plain
|
||||||
tests/tbf/ub0158a.pp svneol=native#text/plain
|
tests/tbf/ub0158a.pp svneol=native#text/plain
|
||||||
@ -11531,6 +11533,9 @@ tests/tbs/tb0641.pp svneol=native#text/pascal
|
|||||||
tests/tbs/tb0642.pp svneol=native#text/pascal
|
tests/tbs/tb0642.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0643.pp svneol=native#text/pascal
|
tests/tbs/tb0643.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0644.pp svneol=native#text/pascal
|
tests/tbs/tb0644.pp svneol=native#text/pascal
|
||||||
|
tests/tbs/tb0645a.pp svneol=native#text/pascal
|
||||||
|
tests/tbs/tb0645b.pp svneol=native#text/pascal
|
||||||
|
tests/tbs/tb0645c.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb205.pp svneol=native#text/plain
|
tests/tbs/tb205.pp svneol=native#text/plain
|
||||||
tests/tbs/tb610.pp svneol=native#text/pascal
|
tests/tbs/tb610.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb613.pp svneol=native#text/plain
|
tests/tbs/tb613.pp svneol=native#text/plain
|
||||||
|
@ -976,8 +976,10 @@ unit scandir;
|
|||||||
current_scanner.skipspace;
|
current_scanner.skipspace;
|
||||||
current_scanner.readstring;
|
current_scanner.readstring;
|
||||||
s:=pattern;
|
s:=pattern;
|
||||||
if c in ['+','-'] then
|
{ don't combine the assignments to s as the method call will be
|
||||||
s:=s+current_scanner.readstate;
|
done before "pattern" is assigned to s and the method changes
|
||||||
|
"pattern" }
|
||||||
|
s:=s+current_scanner.readoptionalstate('+');
|
||||||
if not SetCompileModeSwitch(s,false) then
|
if not SetCompileModeSwitch(s,false) then
|
||||||
Message1(scan_w_illegal_switch,s)
|
Message1(scan_w_illegal_switch,s)
|
||||||
end;
|
end;
|
||||||
|
25
tests/tbf/tb0257a.pp
Normal file
25
tests/tbf/tb0257a.pp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{ %FAIL }
|
||||||
|
|
||||||
|
unit tb0257a;
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
{$modeswitch advancedrecords-}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = record
|
||||||
|
procedure Test;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TTest }
|
||||||
|
|
||||||
|
procedure TTest.Test;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
25
tests/tbf/tb0257b.pp
Normal file
25
tests/tbf/tb0257b.pp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{ %FAIL }
|
||||||
|
|
||||||
|
unit tb0257b;
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
{$modeswitch advancedrecords off}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = record
|
||||||
|
procedure Test;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TTest }
|
||||||
|
|
||||||
|
procedure TTest.Test;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
23
tests/tbs/tb0645a.pp
Normal file
23
tests/tbs/tb0645a.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
unit tb0645a;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
{$modeswitch advancedrecords}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = record
|
||||||
|
procedure Test;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TTest }
|
||||||
|
|
||||||
|
procedure TTest.Test;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
23
tests/tbs/tb0645b.pp
Normal file
23
tests/tbs/tb0645b.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
unit tb0645b;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
{$modeswitch advancedrecords+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = record
|
||||||
|
procedure Test;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TTest }
|
||||||
|
|
||||||
|
procedure TTest.Test;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
23
tests/tbs/tb0645c.pp
Normal file
23
tests/tbs/tb0645c.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
unit tb0645c;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
{$modeswitch advancedrecords on}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = record
|
||||||
|
procedure Test;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TTest }
|
||||||
|
|
||||||
|
procedure TTest.Test;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user