[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlight.Analize and other things


On Thu, 12 Nov 2026 at 17:16, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 10/11/2026 à 20:29, Bruce Steers a écrit :
> > IS the Highlight.Analize method and things like TextEditor.GetHighlight
> > geared to work with the new gb.highlight system?
> >
> > I wonder as all uses of it i see compare types to gb.eval Highlight
> > constants like Higlight.String, Highlight.Comment, etc but the new
> > system expands the types to include others. for example a bash shebang
> > line. (of which the is no constant)
> >
> > Am I able to use Highlight.class on other highlighters other than gambas?
> > The wiki says it's for gambas code but it might just need updating since
> > gb.highlight changes.
> >
> > Or is there some other function from gb.highlight that mirrors gb.eval
> > Highlight.class functions for other highlighters to analize code?
> >
> > Respects
> > BruceS
> >
>
> 'Highlight.Analyze()' is for parsing Gambas code, and it uses
> 'Highlight' constants.
>
> The 'gb.highlight' component has a custom 'TextHighlighter_Gambas' class
> that uses 'Highlight.Analyze()', and that transforms the 'Highlight'
> constants into highlighter states.
>
> What's the problem with that?
>
> --
> Benoît Minisini.


No problem with that. But i was not wanting to do anything with gambas
files or gambas highlight, that's already been taken care of by you..

I'm using shell highlighting and wanted to use analyze and get a list of
it's symbols/types/etc to examine and work on.
I figured the Analyze function worked with each highlighter as each
highlighter must analyze the code it highlights.
So my thinking was all highlighting must be able to Analyze() itself.
But using Analyze on sh code makes no sense of the Symbol Type values. they
are all wrong if it's not gambas code.

I'm asking if there is an Analyze() method that works with other file type
highlights,  not an alternative way to analyze gambas files.
I could no find Analyze() as part of TextHighlighter.class. All i see is
the gambas only gb.eval Hghlight.Analyze()

Respects
BruceS

Follow-Ups:
Re: Highlight.Analize and other thingsBruce Steers <bsteers4@xxxxxxxxx>
References:
Highlight.Analize and other thingsBruce Steers <bsteers4@xxxxxxxxx>
Re: Highlight.Analize and other thingsBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>