SynWrite and CudaText differences

All questions regarding lexer highlighting schemes are discussed here...
Post Reply
Shovel
Posts: 141
Joined: 31.12.2019 10:16

SynWrite and CudaText differences

Post by Shovel »

First two lines are not highlighted in CudaText. If this is not a bug I would appreciate any advice on how to fix it.

lexer in question - rule 'FuncCall'
Attachments
pylex.png
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

this lexer has unusual config for parsers 'id after .' and '^id'. you must set to both them the "token style", you missed it. (in the 'parser' tab.)
this token-style will colorize them. so you will not need to make the "rules" block for them, ok?
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

I'm trying to have separate colors for :

* keywords - listed in rule 'Keywords'
* builtin functions - rule 'Functions'
* 'id' tokens with a following '('
* all other 'id' tokens

I thought accomplishing this would be easier with Rules ('FuncCall' Rule), then creating more parsers.

I removed token style from 'id' parsers because I think I can't override that style from a Rule.
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

Maybe Cud cannot handle this 'missed style' of tokens, assign some style to them. it's better to set style via 'parsers'! so better remove that 'rule' and do it via 'parser'.

parsing has 2 stages, and if you set style via 'parser', style will be found by stage-1 (else: stage-2).
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

Thanks, was simple to do with parsers, all is well now
Post Reply