rust.nanorc 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. # function definition
  7. color magenta "fn [a-z0-9_]+"
  8. # Reserved words
  9. color yellow "\<(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)\>"
  10. # macros
  11. color red "[a-z_]+!"
  12. # Constants
  13. color magenta "[A-Z][A-Z_]+"
  14. # Traits/Enums/Structs/Types/etc.
  15. color magenta "[A-Z][a-z]+"
  16. # Strings
  17. color green "\".*\""
  18. color green start="\".*\\$" end=".*\""
  19. # NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
  20. color green start="r#+\"" end="\"#+"
  21. # Comments
  22. color blue "//.*"
  23. color blue start="/\*" end="\*/"
  24. # Attributes
  25. color magenta start="#!\[" end="\]"
  26. # Some common markers
  27. color brightcyan "(XXX|TODO|FIXME|\?\?\?)"