2008-05-31 21:55:21 +00:00
|
|
|
## Here is an example for awk.
|
2014-05-16 20:21:34 +00:00
|
|
|
|
2008-05-31 21:55:21 +00:00
|
|
|
syntax "awk" "\.awk$"
|
2011-02-13 04:23:10 +00:00
|
|
|
magic "awk.*script text"
|
2016-05-25 20:13:50 +00:00
|
|
|
comment "#"
|
2014-05-16 20:21:34 +00:00
|
|
|
|
|
|
|
# Records.
|
2008-05-31 21:55:21 +00:00
|
|
|
icolor brightred "\$[0-9A-Z_!@#$*?-]+"
|
2014-05-16 20:21:34 +00:00
|
|
|
# Awk-set variables.
|
2008-05-31 21:55:21 +00:00
|
|
|
color red "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>"
|
|
|
|
color red "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>"
|
|
|
|
color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
|
2014-05-16 20:21:34 +00:00
|
|
|
# Function declarations and special patterns.
|
2008-05-31 21:55:21 +00:00
|
|
|
color brightgreen "\<(function|extension|BEGIN|END)\>"
|
2014-05-16 20:21:34 +00:00
|
|
|
# Operators.
|
2008-05-31 21:55:21 +00:00
|
|
|
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
|
2014-05-16 20:21:34 +00:00
|
|
|
# Flow control.
|
2008-05-31 21:55:21 +00:00
|
|
|
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
|
|
|
|
color brightyellow "\<(break|continue|return)\>"
|
2014-05-16 20:21:34 +00:00
|
|
|
# I/O statements.
|
2008-05-31 21:55:21 +00:00
|
|
|
color brightgreen "\<(close|getline|next|nextfile|print|printf)\>"
|
|
|
|
color brightgreen "\<(system|fflush)\>"
|
2014-05-16 20:21:34 +00:00
|
|
|
# Standard functions.
|
2008-05-31 21:55:21 +00:00
|
|
|
color magenta "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>"
|
|
|
|
color magenta "\<(asort|asorti|gensub|gsub|index|length|match)\>"
|
|
|
|
color magenta "\<(split|sprintf|strtonum|sub|substr|tolower|toupper)\>"
|
|
|
|
color magenta "\<(mktime|strftime|systime)\>"
|
|
|
|
color magenta "\<(and|compl|lshift|or|rshift|xor)\>"
|
|
|
|
color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>"
|
|
|
|
|
2014-05-16 20:21:34 +00:00
|
|
|
# Strings.
|
2008-05-31 21:55:21 +00:00
|
|
|
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
2014-05-16 20:21:34 +00:00
|
|
|
# Comments.
|
2008-05-31 21:55:21 +00:00
|
|
|
color brightblue "(^|[[:space:]])#.*$"
|
|
|
|
|
2014-05-16 20:21:34 +00:00
|
|
|
# Trailing whitespace.
|
2008-05-31 21:55:21 +00:00
|
|
|
color ,green "[[:space:]]+$"
|