[Gambas-user] where does the TextEditor turn "?" to "Print" ?

Benoit Minisini benoit.minisini at gambas-basic.org
Mon Mar 20 22:05:41 CET 2023


Le 20/03/2023 à 19:54, Bruce Steers a écrit :
> Was going to see if i could get my gambas to replace "??" for "Debug" 
> like it replaces "?" for "Print"
> 
> cant find where it does it, looked all round gb.form.editor and 
> gb.eval.highlight
> 
> And clues anyone?
> 
> Cheers
> BruceS
> 

The TextEditor does nothing.

It's the 'gb.eval.highlight' component that has support for highlighting 
that both highlights and rewrites the highlighted text.

The Gambas highlighting is done in the 'gb.eval' component.

The transformation of "?" into "PRINT" is done in 'eval_read.c' at line 
400 (in 'master').

It's done after the parser has done its job, so it's just a matter of 
replacing the token for question mark by the token of PRINT, only if we 
want to rewrite the code ('EVAL->analyze' is 'TRUE' then).

Regards,

-- 
Benoît Minisini.



More information about the User mailing list