Sign in Join

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

Mailing lists / fpc-pascal / 2012-12

Codetools and C-style constructs

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Howard Page-Clark

Looking through some of the codetools sources makes me wonder if the codetools overlooks some C-style FPC operators.

KeywordFuncLists.pas, for instance, seems not to know about >>, <<, +=, -=, *=, /=.

Or are these operators are catered for elsewhere in the codetools?

Howard

Reply by email

Mattias Gaertner
to Howard Page-Clark
Show quoted text 5 lines
Looking through some of the codetools sources makes me wonder if the codetools overlooks some C-style FPC operators. KeywordFuncLists.pas, for instance, seems not to know about >>, <<, +=, -=, *=, /=.

I added the << and >>.
The others are assignment operators. AFAIK they can not be overloaded.

Or are these operators are catered for elsewhere in the codetools?

Can you give an example, in what context you are missing an operator?

Mattias

Reply by email

Howard Page-Clark
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
> Looking through some of the codetools sources makes me wonder if the > codetools overlooks some C-style FPC operators. > > KeywordFuncLists.pas, for instance, seems not to know about >>, <<, > +=, -=, *=, /=. I added the << and >>. The others are assignment operators. AFAIK they can not be overloaded. > Or are these operators are catered for elsewhere in the codetools? Can you give an example, in what context you are missing an operator?

I have not encountered any errors in relation to codetoools handling of these operators, and I had not understood the overload orientation of the routines in that unit. I'm just trying to fathom how some of the functionality works (from browsing the source), piece by piece.

Howard

Reply by email

Sven Barth
to Mattias Gaertner: On Tue, 18 Dec 2012 21:13:22 +0000 I added the << and >>. The others are assignment…
Mattias Gaertner wrote 10 lines
On Tue, 18 Dec 2012 21:13:22 +0000 Howard Page-Clark wrote: > Looking through some of the codetools sources makes me wonder if the > codetools overlooks some C-style FPC operators. > > KeywordFuncLists.pas, for instance, seems not to know about >>, <<, > +=, -=, *=, /=. I added the << and >>. The others are assignment operators. AFAIK they can not be overloaded.

Note: "<<" and ">>" are handled by FPC's scanner, so they are exactly the same as "shl" and "shr"

The others can be overloaded insofar that the baseoperator is used as the C-style assignment operators are simply expanded by the parser (e.g. a += b becomes a := a + b and thus the "+" operator applies)

Regards,
Sven

Reply by email