Page 1 of 1

What are the TokenTypes

Posted: 19.06.2025 03:39
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

Re: What are the TokenTypes

Posted: 19.06.2025 07:19
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

Re: What are the TokenTypes

Posted: 19.06.2025 12:12
by RogerTunnicliffe
Thx Alexey, knew it was something binary
Cheers
Roger