mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:09:20 +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
|
if not Handled then
|
||||||
begin
|
begin
|
||||||
Handled:=true;
|
Handled:=true;
|
||||||
|
Param:=Trim(Param);
|
||||||
Case UpperCase(Directive) of
|
Case UpperCase(Directive) of
|
||||||
'ASSERTIONS':
|
'ASSERTIONS':
|
||||||
DoBoolDirective(bsAssertions);
|
DoBoolDirective(bsAssertions);
|
||||||
@ -4083,6 +4084,7 @@ procedure TPascalScanner.HandleBoolDirective(bs: TBoolSwitch;
|
|||||||
const Param: String);
|
const Param: String);
|
||||||
var
|
var
|
||||||
NewValue: Boolean;
|
NewValue: Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if CompareText(Param,'on')=0 then
|
if CompareText(Param,'on')=0 then
|
||||||
NewValue:=true
|
NewValue:=true
|
||||||
|
@ -249,6 +249,7 @@ type
|
|||||||
Procedure TestModeSwitch;
|
Procedure TestModeSwitch;
|
||||||
Procedure TestOperatorIdentifier;
|
Procedure TestOperatorIdentifier;
|
||||||
Procedure TestUTF8BOM;
|
Procedure TestUTF8BOM;
|
||||||
|
Procedure TestBooleanSwitch;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -1771,6 +1772,16 @@ begin
|
|||||||
DoTestToken(tkLineEnding,#$EF+#$BB+#$BF);
|
DoTestToken(tkLineEnding,#$EF+#$BB+#$BF);
|
||||||
end;
|
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
|
initialization
|
||||||
RegisterTests([TTestTokenFinder,TTestStreamLineReader,TTestScanner]);
|
RegisterTests([TTestTokenFinder,TTestStreamLineReader,TTestScanner]);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user