It's not something we need to implement - it's already implemented by the lexer.
To be exact, underscores denote an *unused* variable (called a "singleton"). The lexer [maps them][0] to `SCE_VISUALPROLOG_ANONYMOUS`:
~~~cpp } else if (sc.Match('_')) { sc.SetState(SCE_VISUALPROLOG_ANONYMOUS); ~~~
Only words in proper title-case [are styled][1] as `SCE_VISUALPROLOG_VARIABLE`:
~~~cpp } else if (isUpperLetter(sc.ch)) { sc.SetState(SCE_VISUALPROLOG_VARIABLE); ~~~
![vpl-singleton](https://user-images.githubusercontent.com/59004801/165650011-e7d48c7f-b1b7-4...)
[0]: https://github.com/ScintillaOrg/lexilla/blob/b7b401a2b169aa58dffa96888aca96b... [1]: https://github.com/ScintillaOrg/lexilla/blob/b7b401a2b169aa58dffa96888aca96b...