blob: 0c5abce94d6ef0a5ccb4df862babc9298bcca1eb [file] [log] [blame]
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +00001## Here is an example for Ruby.
Benno Schulenbergfe9da942014-05-16 20:21:34 +00002
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +00003syntax "ruby" "\.rb$"
Benno Schulenbergedabd272014-09-21 15:29:40 +00004header "^#!.*ruby[-0-9._]*"
Benno Schulenberg3de2c702015-04-18 11:35:23 +00005linter ruby -w -c
Mike Scalora6a2032f2016-05-25 22:13:50 +02006comment "#"
Benno Schulenbergfe9da942014-05-16 20:21:34 +00007
Benno Schulenberged2f0b32015-02-21 10:34:15 +00008# Reserved words.
9color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module)\>"
10color yellow "\<(next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000011# Constants.
David Lawrence Ramseyc2e585e2006-07-07 13:54:38 +000012color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000013# Ruby "symbols".
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000014icolor magenta "([ ]|^):[0-9A-Z_]+\>"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000015# Some unique things we want to stand out.
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000016color brightyellow "\<(__FILE__|__LINE__)\>"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000017# Regular expressions.
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000018color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000019# Shell command expansion is in `backticks` or like %x{this}. These are
20# "double-quotish" (to use a perlism).
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000021color brightblue "`[^`]*`" "%x\{[^}]*\}"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000022# Strings, double-quoted.
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000023color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000024# Expression substitution. These go inside double-quoted strings,
25# "like #{this}".
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000026color brightgreen "#\{[^}]*\}"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000027# Strings, single-quoted.
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000028color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000029# Comments.
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000030color cyan "#[^{].*$" "#$"
31color brightcyan "##[^{].*$" "##$"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000032# "Here" docs.
David Lawrence Ramsey93682172006-06-08 12:49:57 +000033color green start="<<-?'?EOT'?" end="^EOT"
Benno Schulenbergfe9da942014-05-16 20:21:34 +000034# Some common markers.
David Lawrence Ramsey5e6434c2006-06-01 17:23:28 +000035color brightcyan "(XXX|TODO|FIXME|\?\?\?)"