]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/rust.micro
added pascal syntax
[micro.git] / runtime / syntax / 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 # Numbers
20 color constant.number "\b[0-9]+\b"
21
22 # Traits/Enums/Structs/Types/etc.
23 color type "[A-Z][a-z]+"
24
25 # Strings
26 color constant.string "\".*\""
27 color constant.string start="\".*\\$" end=".*\""
28 # NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
29 color green start="r#+\"" end="\"#+"
30
31 # Comments
32 color comment "//.*"
33 color comment start="/\*" end="\*/"
34
35 # Attributes
36 color special start="#!\[" end="\]"
37
38 # Some common markers
39 color todo "(XXX|TODO|FIXME|\?\?\?)"