Syntax coloring : Color for Macro

Working on new editor enhancements?
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Syntax coloring : Color for Macro

Post by Comtois »

it would be possible to add a color different for the macro ?

example :

Code: Select all

Truc.Point

Macro Toto(P)
  Do someThing
EndMacro 

Procedure Titi(*P.Point)
  Do something
EndProcedure

Toto(Truc)  ; It would be nice to have a color for macro here 
Titi(@Truc) ; because parameter is not the same
I have a lot of macro and procedure , and it is difficult to remember when i have to write (Truc) or (@Truc) .
Please correct my english
http://purebasic.developpez.com/
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

It would be possible, but it could only color macros of the sources that are currently opened.
If you would have declared the macro in some includefile, the IDE cannot know
about it and it would not be colored.
quidquid Latine dictum sit altum videtur
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Ok , thank you .
So i will write macro with Upper case :)
Please correct my english
http://purebasic.developpez.com/
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i guess only for open files is good enough for me, it's the same thing as with procedures and autocomplete, so why not?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

The difference is that with autocomplete if some procedure is not recognized,
its an inconvinience because you have to type it by hand, nothing more.
A wrong hilighting could lead to code errors or atleast to some confusion though.

Lets say you look at the code, see the macro color and go "oh, its a macro"
and write your code according to that. Next time you look at the source you
maybe do not have the file open that defines the macro. (in which case, the
macro use would probably get the procedure or normal text color. You see
that and go "oh, its a procedure" and base your code writing on that, and of
course that is wrong.

The coloring should always be the same and not depend on the content of other
files and wether they are open or not. This is exactly the reason why
Arrays and LinkedLists get colord with the function color, because it is
impossible to determine what exactly it is if the definition is not present
in the current file.
quidquid Latine dictum sit altum videtur
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

freak wrote:It would be possible, but it could only color macros of the sources that are currently opened.
Well, i thing that would be more than nothing :?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Psychophanta wrote:
freak wrote:It would be possible, but it could only color macros of the sources that are currently opened.
Well, i thing that would be more than nothing :?
I thinks it would be less, because you may get puzzled. I would want a autocomplete which checks all includefiles, too(but optional). A "Open Project..." would also be good, it opens one .pb file and all files which are included in this file.
bye,
Daniel
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Yeah, may be :roll:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Post Reply