It would be ideal if @ were also recognized as a SWI-Prolog operator [. . .]
Done.
One more thing. SWI-Prolog [uniquely][1] allows backticks to delimit [string literals][0]:
?- string_chars(`abc`, Chars). Chars = [a, b, c].
I've compared and Vim treats every delimited character sequence as an atom, no matter what the delimiter is, so nothing to be jealous of. But since our lexer already gives a dedicated style to strings, the difference will be apparent:
![geany-pl-sans-bkqouts-himbeere](https://user-images.githubusercontent.com/59004801/165697784-f4c0e8da-5a4f-4...)
I suppose this means yet another lexer property, like this?
~~~diff diff --git a/scintilla/lexilla/lexers/LexVisualProlog.cxx b/scintilla/lexilla/lexers/LexVisualProlog.cxx index 72a75882b..4eb5c2ec9 100644 --- a/scintilla/lexilla/lexers/LexVisualProlog.cxx +++ b/scintilla/lexilla/lexers/LexVisualProlog.cxx @@ -49,8 +49,10 @@ using namespace Lexilla; // Options used for LexerVisualProlog struct OptionsVisualProlog { bool verbatimStrings; + bool backQuotedStrings; OptionsVisualProlog() { verbatimStrings = true; + backQuotedStrings = false; } };
@@ -66,7 +68,8 @@ struct OptionSetVisualProlog : public OptionSet<OptionsVisualProlog> { OptionSetVisualProlog() { DefineProperty("lexer.visualprolog.verbatim.strings", &OptionsVisualProlog::verbatimStrings, "Set to 0 to disable highlighting verbatim strings using '@'."); - + DefineProperty("lexer.visualprolog.backquoted.strings", &OptionsVisualProlog::backQuotedStrings, + "Set to 1 to enable using back quotes (``) to delimit strings."); DefineWordListSets(visualPrologWordLists); } }; @@ -447,6 +450,9 @@ void SCI_METHOD LexerVisualProlog::Lex(Sci_PositionU startPos, Sci_Position leng } else if (sc.Match('"')) { closingQuote = '"'; sc.SetState(SCE_VISUALPROLOG_STRING); + } else if (options.backQuotedStrings && sc.Match('`')) { + closingQuote = '`'; + sc.SetState(SCE_VISUALPROLOG_STRING); } else if (sc.Match('#')) { sc.SetState(SCE_VISUALPROLOG_KEY_DIRECTIVE); } else if (isoperator(static_cast<char>(sc.ch)) || sc.Match('\')) {
~~~
[0]: https://www.swi-prolog.org/pldoc/man?section=string#:~:text=back-quoted%20te... [1]: https://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_e...