| 1 |
filetype: awk |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "\\.awk$" |
| 5 |
header: "^#!.*bin/(env +)?awk( |$)" |
| 6 |
|
| 7 |
rules: |
| 8 |
- preproc: "\\$[A-Za-z0-9_!@#$*?\\-]+" |
| 9 |
- preproc: "\\b(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\\b" |
| 10 |
- preproc: "\\b(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\\b" |
| 11 |
- preproc: "\\b(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\\b" |
| 12 |
- identifier.class: "\\b(function|extension|BEGIN|END)\\b" |
| 13 |
- symbol.operator: "[\\-+*/%^|!=&<>?;:]|\\\\|\\[|\\]" |
| 14 |
- statement: "\\b(for|if|while|do|else|in|delete|exit)\\b" |
| 15 |
- special: "\\b(break|continue|return)\\b" |
| 16 |
- statement: "\\b(close|getline|next|nextfile|print|printf|system|fflush)\\b" |
| 17 |
- statement: "\\b(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\\b" |
| 18 |
- statement: "\\b(asort|asorti|gensub|gsub|index|length|match)\\b" |
| 19 |
- statement: "\\b(split|sprintf|strtonum|sub|substr|tolower|toupper)\\b" |
| 20 |
- statement: "\\b(mktime|strftime|systime)\\b" |
| 21 |
- statement: "\\b(and|compl|lshift|or|rshift|xor)\\b" |
| 22 |
- statement: "\\b(bindtextdomain|dcgettext|dcngettext)\\b" |
| 23 |
- special: "/.*[^\\\\]/" |
| 24 |
|
| 25 |
- constant.string: |
| 26 |
start: "\"" |
| 27 |
end: "\"" |
| 28 |
skip: "\\\\." |
| 29 |
rules: |
| 30 |
- constant.specialChar: "\\\\." |
| 31 |
|
| 32 |
- constant.string: |
| 33 |
start: "'" |
| 34 |
end: "'" |
| 35 |
skip: "\\\\." |
| 36 |
rules: |
| 37 |
- constant.specialChar: "\\\\." |
| 38 |
|
| 39 |
- comment: |
| 40 |
start: "#" |
| 41 |
end: "$" |
| 42 |
rules: |
| 43 |
- todo: "(TODO|XXX|FIXME):?" |
| 44 |
|