Closed Alexey-T closed 2 years ago
Very cool @Alexey-T :-)
Koka is still in flux so the docs can be behind (although I try to keep up). The grammar is developed from the flex&yacc grammar so the full list of keywords is there, see here. Make sure to look in the dev
branch as I recently updated many things.
The lexer.lex
contains the reserved word list. The words that have a token like ID_xxx
are not reserved but have special meaning in a certain context, (like rec
and inline
).
Words like print
etc are just standard functions from std/core.kk
and std/core/types.kk
. You may go through there to get a list of standard types and functions although it may or may not be a good idea to highlight those as it won't work with user defined types?
Great CudaText is in ObjectPascal -- my first programming language :-)
(also, in support/vscode/koka.language-koka/syntaxes/koka.json
is the most advanced highlighter for vscode but it may be a bit overkill as it highlights types by tracking brace nesting which may not be possible in all syntax highlighters :-( )
I am making CudaText (free app) lexer for Koka. I found keyword list + special word list at https://koka-lang.github.io/koka/doc/book.html but they are not complete!
I found more words which seem like keywords. please correct me.
1) keywords list which my lexer colors in bold-black.
2) std id words which my lexer colors in blue
3) type-like names, syntax colors in purple