mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 20:19:25 +02:00
* Trim content of directives
git-svn-id: trunk@45459 -
This commit is contained in:
parent
d2d2904d78
commit
4dcae91474
@ -3969,6 +3969,7 @@ begin
|
||||
if not Handled then
|
||||
begin
|
||||
Handled:=true;
|
||||
Param:=Trim(Param);
|
||||
Case UpperCase(Directive) of
|
||||
'ASSERTIONS':
|
||||
DoBoolDirective(bsAssertions);
|
||||
@ -4083,6 +4084,7 @@ procedure TPascalScanner.HandleBoolDirective(bs: TBoolSwitch;
|
||||
const Param: String);
|
||||
var
|
||||
NewValue: Boolean;
|
||||
|
||||
begin
|
||||
if CompareText(Param,'on')=0 then
|
||||
NewValue:=true
|
||||
|
@ -249,6 +249,7 @@ type
|
||||
Procedure TestModeSwitch;
|
||||
Procedure TestOperatorIdentifier;
|
||||
Procedure TestUTF8BOM;
|
||||
Procedure TestBooleanSwitch;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -1771,6 +1772,16 @@ begin
|
||||
DoTestToken(tkLineEnding,#$EF+#$BB+#$BF);
|
||||
end;
|
||||
|
||||
Procedure TTestScanner.TestBooleanSwitch;
|
||||
|
||||
begin
|
||||
Scanner.CurrentBoolSwitches:=[bsHints];
|
||||
// end space intentional.
|
||||
NewSource('{$HINTS OFF }');
|
||||
While not (Scanner.FetchToken=tkEOF) do;
|
||||
AssertFalse('Hints off',bshints in Scanner.CurrentBoolSwitches);
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTests([TTestTokenFinder,TTestStreamLineReader,TTestScanner]);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user