mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-14 02:44:35 +03:00
fix rust pub highlight
This commit is contained in:
parent
e04cc1b4c8
commit
a25ef2bd6d
@ -82,8 +82,9 @@ add-highlighter shared/rust/code/question_mark regex \? 0:meta
|
||||
add-highlighter shared/rust/code/function_call regex _?[a-zA-Z]\w*\s*(?=\() 0:function
|
||||
add-highlighter shared/rust/code/generic_function_call regex _?[a-zA-Z]\w*\s*(?=::<) 0:function
|
||||
add-highlighter shared/rust/code/function_declaration regex (?:fn\h+)(_?\w+)(?:<[^>]+?>)?\( 1:function
|
||||
add-highlighter shared/rust/code/keywords regex \b(?:let|as|fn|return|match|if|else|loop|for|in|while|break|continue|box|where|impl|dyn|unsafe|async|await|mod|crate|use|extern|trait|struct|enum|union|type|default)\b 0:keyword
|
||||
add-highlighter shared/rust/code/keywords regex \b(?:as|break|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|pub|return|self|Self|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|try)\b 0:keyword
|
||||
add-highlighter shared/rust/code/storage regex \b(move|mut|ref|static|const)\b 0:type
|
||||
add-highlighter shared/rust/code/pub_with_scope regex \b(pub)\h*(\()\h*(crate|super|self|in\h+[\w:]+)\h*(\)) 1:keyword 2:meta 4:meta
|
||||
# after let can be an arbitrary pattern match
|
||||
add-highlighter shared/rust/code/macro regex \b\w+! 0:meta
|
||||
# the number literals syntax is defined here:
|
||||
|
1
test/highlight/rust/pub/cmd
Normal file
1
test/highlight/rust/pub/cmd
Normal file
@ -0,0 +1 @@
|
||||
|
17
test/highlight/rust/pub/in
Normal file
17
test/highlight/rust/pub/in
Normal file
@ -0,0 +1,17 @@
|
||||
// bare
|
||||
pub
|
||||
|
||||
// with scope
|
||||
pub(crate)
|
||||
pub (crate)
|
||||
pub(super)
|
||||
pub(self)
|
||||
pub(in ::foo)
|
||||
pub(in foo)
|
||||
pub(in foo::bar)
|
||||
pub(in foo::bar::baz)
|
||||
|
||||
// not valid pub expression, parens not colored
|
||||
pub(crat)
|
||||
pub(in)
|
||||
spub(crate)
|
3
test/highlight/rust/pub/rc
Normal file
3
test/highlight/rust/pub/rc
Normal file
@ -0,0 +1,3 @@
|
||||
source "%val{runtime}/colors/default.kak"
|
||||
source "%val{runtime}/rc/filetype/rust.kak"
|
||||
set buffer filetype rust
|
7
test/highlight/rust/pub/script
Normal file
7
test/highlight/rust/pub/script
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user