2016-03-21 16:16:02 +00:00
## Here is an example for Ruby.
##
2016-08-25 00:15:36 +00:00
syntax "ruby" "\.rb$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile"
2016-03-21 16:16:02 +00:00
header "^#!.*/(env +)?ruby( |$)"
## Asciibetical list of reserved words
2016-03-21 20:02:58 +00:00
color statement "\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b"
2016-03-21 16:16:02 +00:00
## Constants
2016-03-21 20:02:58 +00:00
color constant "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
2016-08-27 21:10:26 +00:00
color constant.number "\b[0-9]+\b"
2016-03-21 16:16:02 +00:00
## Ruby "symbols"
2016-03-21 20:02:58 +00:00
color constant (i) "([ ]|^):[0-9A-Z_]+\b"
2016-03-21 16:16:02 +00:00
## Some unique things we want to stand out
2016-03-21 20:02:58 +00:00
color constant "\b(__FILE__|__LINE__)\b"
2016-03-21 16:16:02 +00:00
## Regular expressions
2016-03-21 20:02:58 +00:00
color constant "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
2016-03-21 16:16:02 +00:00
## Shell command expansion is in `backticks` or like %x{this}. These are
## "double-quotish" (to use a perlism).
2016-08-27 21:10:26 +00:00
color constant.string "`[^`]*`" "%x\{[^}]*\}"
2016-03-21 16:16:02 +00:00
## Strings, double-quoted
2016-08-27 21:10:26 +00:00
color constant.string ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
2016-03-21 16:16:02 +00:00
## Expression substitution. These go inside double-quoted strings,
## "like #{this}".
2016-03-21 20:02:58 +00:00
color special "#\{[^}]*\}"
2016-03-21 16:16:02 +00:00
## Strings, single-quoted
2016-08-27 21:10:26 +00:00
color constant.string "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
2016-03-21 16:16:02 +00:00
## Comments
2016-03-21 20:02:58 +00:00
color comment "#[^{].*$" "#$"
color comment "##[^{].*$" "##$"
2016-03-21 16:16:02 +00:00
## "Here" docs
2016-03-25 20:41:36 +00:00
color constant start="<<-?'?EOT'?" end="^EOT"
2016-03-21 16:16:02 +00:00
## Some common markers
2016-03-21 20:02:58 +00:00
color todo "(XXX|TODO|FIXME|\?\?\?)"
2016-03-21 18:48:17 +00:00