2020-04-20 20:15:43 +03:00
|
|
|
## Syntax highlighting for C/C++/Obj-C files.
|
2014-05-17 00:21:34 +04:00
|
|
|
|
2018-02-07 13:25:46 +03:00
|
|
|
syntax m "\.m$"
|
2017-11-19 13:10:53 +03:00
|
|
|
magic "Objective-C source"
|
2016-05-25 23:13:50 +03:00
|
|
|
comment "//"
|
2008-10-01 04:49:19 +04:00
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# Stuffs,
|
|
|
|
color brightwhite "\<[A-Z_][0-9A-Z_]+\>"
|
2008-10-01 04:49:19 +04:00
|
|
|
color green "\<(float|double|BOOL|bool|char|int|short|long|id|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
|
|
|
|
color green "\<[[:alpha:]_][[:alnum:]_]*_t\>"
|
|
|
|
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
|
|
|
|
color brightgreen "\<(for|if|while|do|else|case|default|switch)\>"
|
|
|
|
color brightgreen "\<(try|throw|catch|operator|new|delete)\>"
|
|
|
|
color brightgreen "\<(goto|continue|break|return)\>"
|
2017-12-30 19:32:15 +03:00
|
|
|
color brightgreen "@(encode|end|implementation|interface)|selector)\>"
|
2014-02-23 20:07:44 +04:00
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# GCC builtins.
|
2021-04-27 12:18:41 +03:00
|
|
|
color cyan "__attribute__[[:blank:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
2008-10-01 04:49:19 +04:00
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# Selector/method.
|
2021-04-27 12:18:41 +03:00
|
|
|
color brightmagenta "(^|[[:blank:]])\[.*[[:blank:]].*\]"
|
2008-10-01 04:49:19 +04:00
|
|
|
color white ":[[:alnum:]]*"
|
|
|
|
color magenta "[[:alnum:]]*:"
|
2021-04-27 12:18:41 +03:00
|
|
|
color white "\[[^][:blank:]]*\]"
|
2008-10-01 04:49:19 +04:00
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# Strings.
|
2021-10-18 13:04:31 +03:00
|
|
|
color brightblack "'([^'\]|(\\["'abfnrtv\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
2021-10-27 10:45:42 +03:00
|
|
|
color brightblack "<[^= ]*>|"([^"\]|\\.)*""
|
|
|
|
color brightblue "@"([^"\]|\\.)*""
|
2008-10-01 04:49:19 +04:00
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# Preprocessor commands.
|
2021-04-27 12:18:41 +03:00
|
|
|
color brightblue "^[[:blank:]]*#[[:blank:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
2008-10-01 04:49:19 +04:00
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# Comments.
|
2008-10-01 04:49:19 +04:00
|
|
|
color yellow "//.*"
|
|
|
|
color yellow start="/\*" end="\*/"
|
|
|
|
|
2018-11-03 22:41:42 +03:00
|
|
|
# Trailing whitespace.
|
2014-05-17 00:21:34 +04:00
|
|
|
color ,green "[[:space:]]+$"
|