I built a language server for my forth-like that supports semantic highlighting.
It can distinguish between immediate (comptime) words, normal words, assembly words, and numbers, and immediate words can hack into the token parsing to signal different semantic values.
For example, here I define a new immediate word “\”, which parses until the end of the line using the magic number “3” to mark the parsed text as a comment, and then discards the parsed result.