diff --git a/Lisp/Lisp.sublime-syntax b/Lisp/Lisp.sublime-syntax index 6047a03ebb..f76e04abd0 100644 --- a/Lisp/Lisp.sublime-syntax +++ b/Lisp/Lisp.sublime-syntax @@ -643,13 +643,20 @@ contexts: 1: punctuation.definition.symbol.begin.lisp 2: punctuation.definition.symbol.end.lisp pop: 1 - # special functions mutating data in-place end with ! + # mutating functions changing data in-place end with ! - match: (?![+*#`'&]\S){{identifier}}\!{{break}} scope: meta.function-call.lisp variable.function.mutating.lisp captures: 1: punctuation.definition.symbol.begin.lisp 2: punctuation.definition.symbol.end.lisp pop: 1 + # predicate functions returning boolean values end with ? or -p + - match: (?![+*#`'&]\S){{identifier}}(?:\?|-p){{break}} + scope: meta.function-call.lisp variable.function.predicate.lisp + captures: + 1: punctuation.definition.symbol.begin.lisp + 2: punctuation.definition.symbol.end.lisp + pop: 1 # anything not looking like global variable, constant or macro - match: (?![+*#`'&]\S|{{builtin_constants}}|{{builtin_types}}){{identifier}} scope: meta.function-call.lisp variable.function.lisp diff --git a/Lisp/tests/syntax_test_lisp.lisp b/Lisp/tests/syntax_test_lisp.lisp index 542a1e2b58..d15ea4c39e 100644 --- a/Lisp/tests/syntax_test_lisp.lisp +++ b/Lisp/tests/syntax_test_lisp.lisp @@ -1486,6 +1486,34 @@ ; ^ variable.other.lisp ; ^ variable.other.lisp +(predicate? a b c) +;^^^^^^^^^^ meta.function-call.lisp variable.function.predicate.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp + +(pkg:predicate? a b c) +;^^^ variable.namespace.lisp +; ^ punctuation.accessor.lisp +; ^^^^^^^^^^ meta.function-call.lisp variable.function.predicate.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp + +(fun-p a b c) +;^^^^^ meta.function-call.lisp variable.function.predicate.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp + +(pkg:fun-p a b c) +;^^^ variable.namespace.lisp +; ^ punctuation.accessor.lisp +; ^^^^^ meta.function-call.lisp variable.function.predicate.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp +; ^ variable.other.lisp + ;######## ; LISTS # ;########