1 # Nano configuration for Rust
2 # Copyright 2015 The Rust Project Developers.
4 # NOTE: Rules are applied in order: later rules re-colorize matching text.
8 color identifier "fn [a-z0-9_]+"
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"
14 color special "[a-z_]+!"
17 color constant "[A-Z][A-Z_]+"
20 color constant.number "\b[0-9]+\b"
22 # Traits/Enums/Structs/Types/etc.
23 color type "[A-Z][a-z]+"
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="\"#+"
33 color comment start="/\*" end="\*/"
36 color special start="#!\[" end="\]"
39 color todo "(XXX|TODO|FIXME|\?\?\?)"