Closed danielmartin closed 3 years ago
It's very attractive. I see some minor cases are missing:
// should be highlighted; OK
if !foo {}
if !!!!!foo {}
if !!!!!(foo) {}
if (!foo) {}
let x = [!a,!b]
let x = [a:!b]
// should not be highlighted; Some cases are missing
try! foo
foo as! Foo
foo != bar
foo !== bar
a.b.c!
a.b.c_!
a.b.aあ!
init! {}
let foo: Foo! = bar
let x = foo()! // NG
let x = foo[0]! // NG
// identifiers can be quoted
a.b.`c`! // NG
// custom operator
foo +!+!+!+!+ bbb // NG
How about "\\(?:^\\|\\s-\\|\\s(\\|\\s>\\|[,:;]\\)\\(!+\\)[^=]"
? That is:
,
, ;
, or :
, and!
s=
.@taku0 Thanks for the feedback, I've applied your suggestion. I've also added some font-lock tests to avoid regressions.
Tests for font-locking is a long-awaited feature. It works perfectly on all versions non-interactively and interactively. Thank you.
Emacs can show negation characters using a specific face in font-lock. This commit adds support for it in swift-mode.