blob: 5a14ada33e44c258f6c5a02304d98c43e0c9124d [file] [log] [blame]
Chris Allegretta215eb362008-10-01 00:49:19 +00001## Here is an example for C/C++/Obj-C.
Benno Schulenbergfe9da942014-05-16 20:21:34 +00002
Chris Allegretta215eb362008-10-01 00:49:19 +00003syntax "m" "\.m$"
Mike Scalora6a2032f2016-05-25 22:13:50 +02004comment "//"
Chris Allegretta215eb362008-10-01 00:49:19 +00005
Benno Schulenbergfe9da942014-05-16 20:21:34 +00006# Stuffs,
7color brightwhite "\<[A-Z_][0-9A-Z_]+\>"
Chris Allegretta215eb362008-10-01 00:49:19 +00008color green "\<(float|double|BOOL|bool|char|int|short|long|id|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
9color green "\<[[:alpha:]_][[:alnum:]_]*_t\>"
10color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
11color brightgreen "\<(for|if|while|do|else|case|default|switch)\>"
12color brightgreen "\<(try|throw|catch|operator|new|delete)\>"
13color brightgreen "\<(goto|continue|break|return)\>"
14color brightgreen "@\<(en(code|d)|i(mplementation|nterface)|selector)\>"
Benno Schulenbergc4b344f2014-02-23 16:07:44 +000015
Benno Schulenbergfe9da942014-05-16 20:21:34 +000016# GCC builtins.
Chris Allegretta215eb362008-10-01 00:49:19 +000017color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
18
Benno Schulenbergfe9da942014-05-16 20:21:34 +000019# Selector/method.
Chris Allegretta215eb362008-10-01 00:49:19 +000020color brightmagenta "(^|[[:space:]])\[.*[[:space:]].*\]"
21color white ":[[:alnum:]]*"
22color magenta "[[:alnum:]]*:"
23color white "\[[^][:space:]]*\]"
24
Benno Schulenbergfe9da942014-05-16 20:21:34 +000025# Strings.
Chris Allegretta215eb362008-10-01 00:49:19 +000026color brightblack "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
27color brightblack "<[^= ]*>" ""(\\.|[^"])*""
28color brightblue "@"(\\.|[^"])*""
Benno Schulenbergae598e72015-12-29 16:48:25 +000029# Multiline strings. This regex is VERY resource intensive,
30# and sometimes colours things that shouldn't be coloured.
31###color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
Chris Allegretta215eb362008-10-01 00:49:19 +000032
Benno Schulenbergfe9da942014-05-16 20:21:34 +000033# Preprocessor commands.
Chris Allegretta215eb362008-10-01 00:49:19 +000034color brightblue "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
35
Benno Schulenbergfe9da942014-05-16 20:21:34 +000036# Comments.
Chris Allegretta215eb362008-10-01 00:49:19 +000037color yellow "//.*"
38color yellow start="/\*" end="\*/"
39
Benno Schulenbergfe9da942014-05-16 20:21:34 +000040# Trailing whitespace.  
41color ,green "[[:space:]]+$"