Page 2 of 2
					
				Re: Help to configure folding in my lexer
				Posted: 23.06.2025 07:29
				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.
			 
			
					
				Re: Help to configure folding in my lexer
				Posted: 23.06.2025 09:46
				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
			 
			
					
				Re: Help to configure folding in my lexer
				Posted: 23.06.2025 13:34
				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 
			
					
				Re: Help to configure folding in my lexer
				Posted: 24.06.2025 06:54
				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
			 
			
					
				Re: Help to configure folding in my lexer
				Posted: 24.06.2025 07:13
				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?
			 
			
					
				Re: Help to configure folding in my lexer
				Posted: 24.06.2025 07:24
				by main Alexey
				(del)
			 
			
					
				Re: Help to configure folding in my lexer
				Posted: 12.07.2025 21:00
				by main Alexey
				hi Roger,
sorry but I took the last version, and improved it till the end. as I could see rules, by looking at the 3 sample *.one files.
lexer is now published. in addons manager.
you can ask for improvements in it.