[Lazarus] JCF2 patch in trunk

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] JCF2 patch in trunk

Free Pascal - Lazarus mailing list
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?

Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] JCF2 patch in trunk

Free Pascal - Lazarus mailing list
On Fri, Sep 11, 2020 at 12:15 PM Alexey Tor. via lazarus
<[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] JCF2 patch in trunk

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Fri, 11 Sep 2020 13:14:59 +0300
"Alexey Tor. via lazarus" <[hidden email]> 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.


Mattias

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] JCF2 patch in trunk

Free Pascal - Lazarus mailing list


On Fri, 11 Sep 2020, Mattias Gaertner via lazarus wrote:

> On Fri, 11 Sep 2020 13:14:59 +0300
> "Alexey Tor. via lazarus" <[hidden email]> 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.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus