What are the TokenTypes

All questions regarding lexer highlighting schemes are discussed here...
Post Reply
RogerTunnicliffe
Posts: 5
Joined: 17.06.2025 04:35

What are the TokenTypes

Post by RogerTunnicliffe »

What are the TokenTypes that appear frequently in a Lexer.
for example the Python.lcf

Code: Select all

 item
      DisplayName = 'block for tree, class'
      ConditionList = <
        item
          TokenTypes = 4096
        end
        item
          CondType = tcSkip
          TokenTypes = 59390
        end
        item
          TokenTypes = 131072
        end>
      EndOfTextClose = True
      NameFmt = '%s-1'
      RefToCondEnd = True
      HighlightPos = cpAny
      CancelNextRules = True
      DrawStaple = True
      GroupIndex = 20
      CollapseFmt = '%s0 %s-1...'
      TreeItemImage = 1
      IgnoreAsParent = False
    end
main Alexey
Posts: 2533
Joined: 25.08.2021 18:15

Re: What are the TokenTypes

Post by main Alexey »

You should edit the lexer in the SynWrite's LexerProperties dialog, so dialog will give you the checkListBox control, like this:

[x] Id
[x] Id Keyword
[x] String
[x] Number
....

from your checkboxes, dialog will compose the final number, TokenTypes.
for example:
TokenTypes = 4096
it means 2**12, so it is only checkBox number 12 checked (0-th is first), others are unchecked.
Always use the dialog.
https://wiki.freepascal.org/CudaText#Le ... d_creation
RogerTunnicliffe
Posts: 5
Joined: 17.06.2025 04:35

Re: What are the TokenTypes

Post by RogerTunnicliffe »

Thx Alexey, knew it was something binary
Cheers
Roger
Post Reply