Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-09

JCF2 patch in trunk

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart
to Alexey Tor.
PM Alexey Tor. wrote
if StartsText('{$include',pcToken.SourceCode)=true then lPos:=10 else if StartsStr('{$I',pcToken.SourceCode)=true then

I really dislike this "if BooleanExpression=true" (or: "if BooleanExpression=false").
A simple "if BooleanExpression" suffices (or: "if not BooleanExpression").

Bart

Reply by email

Mattias Gaertner
to Alexey Tor.: https://github.com/graemeg/lazarus/commit/f4ffd5e0640948e9c396e1ef1b2aacd90512ac77   …
Show quoted text 12 lines
https://github.com/graemeg/lazarus/commit/f4ffd5e0640948e9c396e1ef1b2aacd90512ac77    if StartsText('{$include',pcToken.SourceCode)=true then       lPos:=10     else if StartsStr('{$I',pcToken.SourceCode)=true then a) $include is searched case-insens? why no space after "$include" to avoid incorrect include? b) $I is searched case-insens? seems no! why no space after $I to avoid other directive?

Are these trick questions?
Simply reading the code and using Find Declaration answers both questions in less time, than it takes to write this mail.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 19 lines
On Fri, 11 Sep 2020 13:14:59 +0300 "Alexey Tor. via lazarus" wrote: > https://github.com/graemeg/lazarus/commit/f4ffd5e0640948e9c396e1ef1b2aacd90512ac77 > >    if StartsText('{$include',pcToken.SourceCode)=true then >       lPos:=10 >     else if StartsStr('{$I',pcToken.SourceCode)=true then > > > a) $include is searched case-insens? why no space after "$include" to > avoid incorrect include? > > b) $I is searched case-insens? seems no! why no space after $I to > avoid other directive? Are these trick questions? Simply reading the code and using Find Declaration answers both questions in less time, than it takes to write this mail.

I think he tries to point out there is a discrepancy in case-sensitiveness treatment, and that it is safer to add ' ' after the directive to prevent false positives.

Michael.

Reply by email