[Gambas-user] Question about highlight.styles[] list from original eval.highlight class

Brian G brian at westwoodsvcs.com
Mon Dec 11 01:41:07 CET 2023


On 12/10/23 12:00, Benoît Minisini wrote:
> Le 10/12/2023 à 18:55, Brian G a écrit :
>> I have a number of programs that analyze the source code, and produce 
>> output, they use this to identify the types of elements found
>>
>> and print in human readable names.   They no longer work!
>>
>
> If you use 'Highlight.Analyze()', the values of the 'Highlight.Types' 
> array are the constants of the 'Highlight' class.
>
> It should be enough for what you need, isn't it? Or did I miss something?
>
It is not enough, the styles array contained the text value for each of 
the types[] entry values. the types entry values were an index into the 
array

styles looked like this

Styles As String[] = ["Background", "Normal", "Selection", "Alternate", 
"Highlight", "CurrentLine", "Added", "Removed", "Error", "Comment", 
"Documentation", "Keyword",
   "Function", "Operator", "Symbol", "Number", "String", "Breakpoint", 
"Current", "Datatype", "Preprocessor", "Escape", "Label", "Constant", 
"Class", "Id", "Element",
   "Property", "Pseudo", "Rule", "Important", "File", "Header", 
"Position", "Markup", "Attribute", "Value", "Entity", "WebMarkup", 
"WebComment", "WebArgument"]

There is nothing equivalent now.

I have code that does this print highlight.styles[types[9]]

which prints 'comment'

My  programs analyze other programs and produce reports using this 
information.

And rely on the text from the styles array that was part of the original 
eval.highlight class

-- 
~~~~ Brian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x78BFB26402F48419.asc
Type: application/pgp-keys
Size: 2428 bytes
Desc: OpenPGP public key
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231210/b1bee886/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 665 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231210/b1bee886/attachment-0001.sig>


More information about the User mailing list