Skip to content

Commit 58079a4

Browse files
committed
Tidy noneOf
1 parent 58d2365 commit 58079a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/languages/swift.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export default function(hljs) {
491491
};
492492

493493
function noneOf(list) {
494-
return concat("(?!", list.join("|"), ")");
494+
return negativeLookahead(either(...list));
495495
}
496496

497497
const METHODS_ONLY = [...Swift.keywords, ...Swift.builtIns];
@@ -504,7 +504,7 @@ export default function(hljs) {
504504
keywords: KEYWORDS,
505505
match: concat(
506506
either(/\b/, /#/),
507-
noneOf([...METHODS_ONLY].map(x => concat(x, TRAILING_PAREN_REGEX))),
507+
noneOf(METHODS_ONLY.map(x => concat(x, TRAILING_PAREN_REGEX))),
508508
FUNCTION_IDENT,
509509
lookahead(TRAILING_PAREN_REGEX),
510510
),

0 commit comments

Comments
 (0)