# Copyright 2015 The Rust Project Developers.
#
# NOTE: Rules are applied in order: later rules re-colorize matching text.
-syntax "Rust" "\.rs"
+syntax "rust" "\.rs"
# function definition
color identifier "fn [a-z0-9_]+"
# Constants
color constant "[A-Z][A-Z_]+"
+# Numbers
+color constant.number "\b[0-9]+\b"
+
# Traits/Enums/Structs/Types/etc.
color type "[A-Z][a-z]+"
# Strings
-color constant "\".*\""
-color constant (s) "\".*?\""
+color constant.string "\".*\""
+color constant.string start="\".*\\$" end=".*\""
# NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
-color constant (s) "r#+\".*?\"#+"
+color green start="r#+\"" end="\"#+"
# Comments
color comment "//.*"
-color comment (s) "/\*.*?\*/"
+color comment start="/\*" end="\*/"
# Attributes
-color special (s) "#!\[.*?\]"
+color special start="#!\[" end="\]"
# Some common markers
color todo "(XXX|TODO|FIXME|\?\?\?)"