struct CatspeakLexer
GameMaker Language (.gml)Copyfunction CatspeakLexer(
buff : Id.Buffer,
offset? : Real,
size? : Real,
keywords? : Struct,
) constructor { }
Responsible for tokenising the contents of a GML buffer. This can be used for syntax highlighting in a programming game which uses Catspeak.
⚠️ WarningThe lexer does not take ownership of its buffer, so you must make sure to delete the buffer once the lexer is complete. Failure to do this will result in leaking memory.
Arguments
buff
The ID of the GML buffer to use.
offset
(optional)The offset in the buffer to start parsing from. Defaults to 0.
size
(optional)The length of the buffer input. Any characters beyond this limit will be treated as the end of the file. Defaults to
infinity
.keywords
(optional)A struct whose keys map to the corresponding Catspeak tokens they represent. Defaults to the vanilla set of Catspeak keywords.