Help to configure folding in my lexer

All questions regarding lexer highlighting schemes are discussed here...
main Alexey
Posts: 2543
Joined: 25.08.2021 18:15

Re: Help to configure folding in my lexer

Post by main Alexey »

//continuation

I also removed flags '[x] strict parent block' and 'parent block: .................' because for simple blocks they are not needed. only complexity added.
RogerTunnicliffe
Posts: 10
Joined: 17.06.2025 04:35

Re: Help to configure folding in my lexer

Post by RogerTunnicliffe »

Thx Alexey.
I am away at the moment so will check it out in a couple of days.

As far as the format entries go, they do make sense and they are not bad. What do you see in the following code that indicates that it is a number, or a comment or an identifier. It is a style that is APPLIED to something. It contains no information as to what it HAS TO be applied to.

Anyway, thanks for your help, I'll take a look at it.
Cheers
Roger

item
DisplayName = 'style-Aqua'
Font.Charset = DEFAULT_CHARSET
Font.Color = clAqua
Font.Height = -13
Font.Name = 'Courier New'
Font.Style = [fsBold, fsItalic]
end
main Alexey
Posts: 2543
Joined: 25.08.2021 18:15

Re: Help to configure folding in my lexer

Post by main Alexey »

but this is tradition of all lexers: name styles like

Number
String
Id
etc...

because when light/dark theme is applied, meaning of 'aqua' style is broken: it is colored with different color in light/dark theme.
to add theme support, follow wiki:
https://wiki.freepascal.org/CudaText#Ho ... _new_lexer
RogerTunnicliffe
Posts: 10
Joined: 17.06.2025 04:35

Re: Help to configure folding in my lexer

Post by RogerTunnicliffe »

Thx Alexey.

I have had a look at this and although the folding seems to work, the coloring no longer does. ie Numbers should be White but are now Deep red (not sure what color that is). Repeat should be Red but are now Aqua. In addition the Code Tree is no longer populated

Any clues
Cheers
Roger
main Alexey
Posts: 2543
Joined: 25.08.2021 18:15

Re: Help to configure folding in my lexer

Post by main Alexey »

1. color of numbers.
that is because I adjusted style on the Synwrite's 'STYLES' tab. White color was not ok (coz Synwrite's default background of editor is white) so I changed color for numbers to DarkBlue with bold. you can adjust it back.

2. color of 'repeat.XXX'.
you can easily adjust it by changing in LexerProps dialog:
PARSER tab -> select rule 'Parser - start repeat' -> change 'Token style' field to any style!

3. code-tree is not filled.
I unchecked the dialog flag '[x] Display in syntax tree' for some your rules in the RULES tab.
check the flag back if you need to show Repeat/If block in the tree.

OK?
can you fix this?
main Alexey
Posts: 2543
Joined: 25.08.2021 18:15

Re: Help to configure folding in my lexer

Post by main Alexey »

changes made according to my post.
numbers (Hex + usual) are now having style 'Number' (green).

zip file.
Attachments
languageONE.zip
(1.76 KiB) Downloaded 1 time
Post Reply