2016-03-21 16:16:02 +00:00
# Nano configuration for Rust
# Copyright 2015 The Rust Project Developers.
#
# NOTE: Rules are applied in order: later rules re-colorize matching text.
2016-08-25 00:15:36 +00:00
syntax "rust" "\.rs"
2016-03-21 16:16:02 +00:00
# function definition
2016-03-21 20:02:58 +00:00
color identifier "fn [a-z0-9_]+"
2016-03-21 16:16:02 +00:00
# Reserved words
2016-03-21 20:02:58 +00:00
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"
2016-03-21 16:16:02 +00:00
# macros
2016-03-21 20:02:58 +00:00
color special "[a-z_]+!"
2016-03-21 16:16:02 +00:00
# Constants
2016-03-21 20:02:58 +00:00
color constant "[A-Z][A-Z_]+"
2016-03-21 16:16:02 +00:00
2016-08-27 21:10:26 +00:00
# Numbers
color constant.number "\b[0-9]+\b"
2016-03-21 16:16:02 +00:00
# Traits/Enums/Structs/Types/etc.
2016-03-21 20:02:58 +00:00
color type "[A-Z][a-z]+"
2016-03-21 16:16:02 +00:00
# Strings
2016-06-25 23:20:13 +00:00
color constant.string "\".*\""
color constant.string start="\".*\\$" end=".*\""
2016-03-21 16:16:02 +00:00
# NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
2016-03-25 20:41:36 +00:00
color green start="r#+\"" end="\"#+"
2016-03-21 16:16:02 +00:00
# Comments
2016-03-21 20:02:58 +00:00
color comment "//.*"
2016-03-25 20:41:36 +00:00
color comment start="/\*" end="\*/"
2016-03-21 16:16:02 +00:00
# Attributes
2016-03-25 20:41:36 +00:00
color special start="#!\[" end="\]"
2016-03-21 16:16:02 +00:00
# Some common markers
2016-03-21 20:02:58 +00:00
color todo "(XXX|TODO|FIXME|\?\?\?)"