The lexers are part of the separate [Scintilla project](https://www.scintilla.org/index.html) which has all the docs on how to write them. Note that Geany uses Scintilla 3 not Scintilla 4 so you can't rely on anything thats not backported.
You should get your lexer accepted there first.