mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-13 17:46:10 +02:00
* properly read +/- for the warn directive, resolves #41105
This commit is contained in:
parent
6ccad3dc4e
commit
56fa196b03
@ -1801,6 +1801,12 @@ unit scandir;
|
|||||||
current_scanner.skipspace;
|
current_scanner.skipspace;
|
||||||
ident:=current_scanner.readid;
|
ident:=current_scanner.readid;
|
||||||
current_scanner.skipspace;
|
current_scanner.skipspace;
|
||||||
|
if c in ['+','-'] then
|
||||||
|
begin
|
||||||
|
state:=c;
|
||||||
|
current_scanner.readchar;
|
||||||
|
end
|
||||||
|
else
|
||||||
state:=current_scanner.readid;
|
state:=current_scanner.readid;
|
||||||
|
|
||||||
{ support both delphi and fpc switches }
|
{ support both delphi and fpc switches }
|
||||||
|
22
tests/webtbs/tw41105.pp
Normal file
22
tests/webtbs/tw41105.pp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
program Project1;
|
||||||
|
|
||||||
|
// id
|
||||||
|
// {$WARN 5023 ON} // compiles
|
||||||
|
// {$WARN 5023 OFF} // compiles
|
||||||
|
{$WARN 5023 +} // ERROR
|
||||||
|
{$WARN 5023 -} // ERROR
|
||||||
|
{$WARN 5023+} // ERROR
|
||||||
|
{$WARN 5023-} // ERROR
|
||||||
|
{$WARN 5023 ERROR} // compiles
|
||||||
|
|
||||||
|
// name
|
||||||
|
{$WARN NO_RETVAL ON} // compiles
|
||||||
|
{$WARN NO_RETVAL OFF} // compiles
|
||||||
|
{$WARN NO_RETVAL +} // ERROR
|
||||||
|
{$WARN NO_RETVAL -} // ERROR
|
||||||
|
{$WARN NO_RETVAL+} // ERROR
|
||||||
|
{$WARN NO_RETVAL-} // ERROR
|
||||||
|
{$WARN NO_RETVAL ERROR} // compiles
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user