bacb0f717d
Since file-5.10 (end of 2011), libmagic identifies a C file in most cases as "C source" instead of as "C program". Nano's magic strings for some other files didn't match any more what file-5.32 currently produces, either. So, they have been adjusted, new ones added, and old ones deleted. This fixes https://savannah.gnu.org/bugs/?52445.
38 строки
1.3 KiB
Plaintext
38 строки
1.3 KiB
Plaintext
## Here is an example for awk.
|
|
|
|
syntax "awk" "\.awk$"
|
|
magic "awk script"
|
|
comment "#"
|
|
|
|
# Records.
|
|
icolor brightred "\$[0-9A-Z_!@#$*?-]+"
|
|
# Awk-set variables.
|
|
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)\>"
|
|
# Function declarations and special patterns.
|
|
color brightgreen "\<(function|extension|BEGIN|END)\>"
|
|
# Operators.
|
|
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
|
|
# Flow control.
|
|
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
|
|
color brightyellow "\<(break|continue|return)\>"
|
|
# I/O statements.
|
|
color brightgreen "\<(close|getline|next|nextfile|print|printf)\>"
|
|
color brightgreen "\<(system|fflush)\>"
|
|
# Standard functions.
|
|
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)\>"
|
|
|
|
# Strings.
|
|
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
|
# Comments.
|
|
color brightblue "(^|[[:space:]])#.*$"
|
|
|
|
# Trailing whitespace.
|
|
color ,green "[[:space:]]+$"
|