]> git.lizzy.rs Git - micro.git/blob - syntax_files/rust.micro
Proper window resize handling
[micro.git] / syntax_files / rust.micro
1 # Nano configuration for Rust
2 # Copyright 2015 The Rust Project Developers.
3 #
4 # NOTE: Rules are applied in order: later rules re-colorize matching text.
5 syntax "Rust" "\.rs"
6
7 # function definition
8 color identifier "fn [a-z0-9_]+"
9
10 # Reserved words
11 color statement "\b(abstract|alignof|as|become|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b"
12
13 # macros
14 color special "[a-z_]+!"
15
16 # Constants
17 color constant "[A-Z][A-Z_]+"
18
19 # Traits/Enums/Structs/Types/etc.
20 color type "[A-Z][a-z]+"
21
22 # Strings
23 color constant "\".*\""
24 color constant (s) "\".*?\""
25 # NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
26 color constant (s) "r#+\".*?\"#+"
27
28 # Comments
29 color comment "//.*"
30 color comment (s) "/\*.*?\*/"
31
32 # Attributes
33 color special (s) "#!\[.*?\]"
34
35 # Some common markers
36 color todo "(XXX|TODO|FIXME|\?\?\?)"