Skip to content

Commit

Permalink
Added keywords and support for ?
Browse files Browse the repository at this point in the history
  • Loading branch information
vedderb committed Sep 29, 2024
1 parent a7480fe commit 45f733e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions QCodeEditor/resources/languages/lisp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -543,5 +543,7 @@
<name>connected-ble</name>
<name>connected-usb</name>
<name>aes-ctr-crypt</name>
<name>number?</name>
<name>list?</name>
</section>
</root>
4 changes: 2 additions & 2 deletions QCodeEditor/src/internal/LispHighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ LispHighlighter::LispHighlighter(QTextDocument* document) :
for (auto&& name : names)
{
m_highlightRulesLang.append({
QRegularExpression(QString(R"(\b%1\b)").arg(name.replace("-", "_"))),
QRegularExpression(QString(R"(\b%1\b)").arg(name.replace("-", "_").replace("?", "_"))),
key
});
}
Expand Down Expand Up @@ -63,7 +63,7 @@ LispHighlighter::LispHighlighter(QTextDocument* document) :
void LispHighlighter::highlightBlock(const QString& text)
{
for (auto&& rule : m_highlightRulesLang) {
auto matchIterator = rule.pattern.globalMatch(QString(text).replace("-", "_").replace("#", "_"));
auto matchIterator = rule.pattern.globalMatch(QString(text).replace("-", "_").replace("#", "_").replace("?", "_"));

while (matchIterator.hasNext()) {
auto match = matchIterator.next();
Expand Down

0 comments on commit 45f733e

Please sign in to comment.