annotate runtime/syntax/awk.vim @ 23923:be36288235af v8.2.2504

patch 8.2.2504: Vim9: crash when using an argument from a closure Commit: https://github.com/vim/vim/commit/44ec21c467ddf481b422c787324ea08f375f6942 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 12 21:50:57 2021 +0100 patch 8.2.2504: Vim9: crash when using an argument from a closure Problem: Vim9: crash when using an argument from a closure. Solution: Check if gen_load_outer is NULL. (closes https://github.com/vim/vim/issues/7821)
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 Feb 2021 22:00:04 +0100
parents 8dad79c661d1
children 65921ec26072
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
22824
8dad79c661d1 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 21991
diff changeset
2 " Language: awk, nawk, gawk, mawk
8dad79c661d1 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 21991
diff changeset
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
8dad79c661d1 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 21991
diff changeset
4 " Previous Maintainer: Antonio Colombo <azc100@gmail.com>
8dad79c661d1 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 21991
diff changeset
5 " Last Change: 2020 Aug 18
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
7 " AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " The AWK Programming Language, Addison-Wesley, 1988
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " GAWK ref. is: Arnold D. Robbins
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " Effective AWK Programming, Third Edition, O'Reilly, 2001
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
12 " Effective AWK Programming, Fourth Edition, O'Reilly, 2015
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
13 " (up-to-date version available with the gawk source distribution)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " MAWK is a "new awk" meaning it implements AWK ref.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " mawk conforms to the Posix 1003.2 (draft 11.3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " definition of the AWK language which contains a few features
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " not described in the AWK book, and mawk provides a small number of extensions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " TODO:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Dig into the commented out syntax expressions below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
23 " Quit when a syntax file was already loaded
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
24 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 216
diff changeset
28 let s:cpo_save = &cpo
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 216
diff changeset
29 set cpo&vim
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 216
diff changeset
30
21991
bbca88cd13d5 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19813
diff changeset
31 syn iskeyword @,48-57,_,192-255,@-@
bbca88cd13d5 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19813
diff changeset
32
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " A bunch of useful Awk keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " AWK ref. p. 188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword awkStatement break continue delete exit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword awkStatement function getline next
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword awkStatement print printf return
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
38 " GAWK ref. Chapter 7-9
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
39 syn keyword awkStatement case default switch nextfile
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
40 syn keyword awkStatement func
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
41 " GAWK ref. Chapter 2.7, Including Other Files into Your Program
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
42 " GAWK ref. Chapter 2.8, Loading Dynamic Extensions into Your Program
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
43 " GAWK ref. Chapter 15, Namespaces
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
44 " Directives
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
45 syn keyword awkStatement @include @load @namespace
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
46 "
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
47 " GAWK ref. Chapter 9, Functions
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
48 " Numeric Functions
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
49 syn keyword awkFunction atan2 cos exp int log rand sin sqrt srand
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
50 " String Manipulation Functions
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
51 syn keyword awkFunction asort asorti gensub gsub index length match
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
52 syn keyword awkFunction patsplit split sprintf strtonum sub substr
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword awkFunction tolower toupper
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
54 " Input Output Functions
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
55 syn keyword awkFunction close fflush system
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
56 " Time Functions
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
57 syn keyword awkFunction mktime strftime systime
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
58 " Bit Manipulation Functions
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
59 syn keyword awkFunction and compl lshift or rshift xor
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10140
diff changeset
60 " Getting Type Information Functions
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
61 syn keyword awkFunction isarray typeof
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
62 " String-Translation Functions
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
63 syn keyword awkFunction bindtextdomain dcgettext dcngetext
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword awkConditional if else
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
66 syn keyword awkRepeat while for do
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
68 syn keyword awkTodo contained TODO
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
70 syn keyword awkPatterns BEGIN END BEGINFILE ENDFILE
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
71
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
72 " GAWK ref. Chapter 7
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
73 " Built-in Variables That Control awk
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
74 syn keyword awkVariables BINMODE CONVFMT FIELDWIDTHS FPAT FS
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
75 syn keyword awkVariables IGNORECASE LINT OFMT OFS ORS PREC
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
76 syn keyword awkVariables ROUNDMODE RS SUBSEP TEXTDOMAIN
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
77 " Built-in Variables That Convey Information
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
78 syn keyword awkVariables ARGC ARGV ARGIND ENVIRON ERRNO FILENAME
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
79 syn keyword awkVariables FNR NF FUNCTAB NR PROCINFO RLENGTH RSTART
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
80 syn keyword awkVariables RT SYMTAB
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
10140
b11ceef7116e commit https://github.com/vim/vim/commit/64d8e25bf6efe5f18b032563521c3ce278c316ab
Christian Brabandt <cb@256bit.org>
parents: 9533
diff changeset
82 " Arithmetic operators: +, and - take care of ++, and --
b11ceef7116e commit https://github.com/vim/vim/commit/64d8e25bf6efe5f18b032563521c3ce278c316ab
Christian Brabandt <cb@256bit.org>
parents: 9533
diff changeset
83 syn match awkOperator "+\|-\|\*\|/\|%\|="
b11ceef7116e commit https://github.com/vim/vim/commit/64d8e25bf6efe5f18b032563521c3ce278c316ab
Christian Brabandt <cb@256bit.org>
parents: 9533
diff changeset
84 syn match awkOperator "+=\|-=\|\*=\|/=\|%="
b11ceef7116e commit https://github.com/vim/vim/commit/64d8e25bf6efe5f18b032563521c3ce278c316ab
Christian Brabandt <cb@256bit.org>
parents: 9533
diff changeset
85 syn match awkOperator "\^\|\^="
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 " Octal format character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match awkSpecialCharacter display contained "\\[0-7]\{1,3\}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 " Hex format character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn match awkSpecialCharacter display contained "\\x[0-9A-Fa-f]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match awkFieldVars "\$\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
94 " catch errors caused by wrong parenthesis
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
95 syn region awkParen transparent start="(" end=")" contains=ALLBUT,awkParenError,awkSpecialCharacter,awkArrayElement,awkArrayArray,awkTodo,awkRegExp,awkBrktRegExp,awkBrackets,awkCharClass,awkComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match awkParenError display ")"
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
97 "syn match awkInParen display contained "[{}]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 " 64 lines for complex &&'s, and ||'s in a big "if"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn sync ccomment awkParen maxlines=64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 " Search strings & Regular Expressions therein.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn region awkSearch oneline start="^[ \t]*/"ms=e start="\(,\|!\=\~\)[ \t]*/"ms=e skip="\\\\\|\\/" end="/" contains=awkBrackets,awkRegExp,awkSpecialCharacter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn region awkBrackets contained start="\[\^\]\="ms=s+2 start="\[[^\^]"ms=s+1 end="\]"me=e-1 contains=awkBrktRegExp,awkCharClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn region awkSearch oneline start="[ \t]*/"hs=e skip="\\\\\|\\/" end="/" contains=awkBrackets,awkRegExp,awkSpecialCharacter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn match awkCharClass contained "\[:[^:\]]*:\]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn match awkBrktRegExp contained "\\.\|.\-[^]]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn match awkRegExp contained "/\^"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 syn match awkRegExp contained "\$/"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syn match awkRegExp contained "[?.*{}|+]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " String and Character constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 " Highlight special characters (those which have a backslash) differently
3513
1b584a6f446c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3312
diff changeset
115 syn region awkString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell,awkSpecialCharacter,awkSpecialPrintf
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 syn match awkSpecialCharacter contained "\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 " Some of these combinations may seem weird, but they work.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 syn match awkSpecialPrintf contained "%[-+ #]*\d*\.\=\d*[cdefgiosuxEGX%]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 " Numbers, allowing signs (both -, and +)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 " Integer number.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 syn match awkNumber display "[+-]\=\<\d\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 " Floating point number.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 syn match awkFloat display "[+-]\=\<\d\+\.\d+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 " Floating point number, starting with a dot.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 syn match awkFloat display "[+-]\=\<.\d+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 "floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn match awkFloat display "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 "floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 syn match awkFloat display "\.\d\+\(e[-+]\=\d\+\)\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 "floating point number, without dot, with exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 syn match awkFloat display "\<\d\+e[-+]\=\d\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 "syn match awkIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 " Comparison expressions.
6530
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
140 syn match awkExpression "==\|>=\|=>\|<=\|=<\|\!="
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
141 syn match awkExpression "\~\|\!\~"
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
142 syn match awkExpression "?\|:"
435956324539 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3513
diff changeset
143 syn keyword awkExpression in
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 " Boolean Logic (OR, AND, NOT)
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
146 syn match awkBoolLogic "||\|&&\|\!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 " This is overridden by less-than & greater-than.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 " Put this above those to override them.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 " Put this in a 'match "\<printf\=\>.*;\="' to make it not override
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 " less/greater than (most of the time), but it won't work yet because
3513
1b584a6f446c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3312
diff changeset
152 " keywords always have precedence over match & region.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 " File I/O: (print foo, bar > "filename") & for nawk (getline < "filename")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 "syn match awkFileIO contained ">"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 "syn match awkFileIO contained "<"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 " Expression separators: ';' and ','
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 syn match awkSemicolon ";"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 syn match awkComma ","
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160
3513
1b584a6f446c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3312
diff changeset
161 syn match awkComment "#.*" contains=@Spell,awkTodo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 syn match awkLineSkip "\\$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 " Highlight array element's (recursive arrays allowed).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 " Keeps nested array names' separate from normal array elements.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 " Keeps numbers separate from normal array elements (variables).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 syn match awkArrayArray contained "[^][, \t]\+\["me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 syn match awkArrayElement contained "[^][, \t]\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 syn region awkArray transparent start="\[" end="\]" contains=awkArray,awkArrayElement,awkArrayArray,awkNumber,awkFloat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 " 10 should be enough.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 " (for the few instances where it would be more than "oneline")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 syn sync ccomment awkArray maxlines=10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
9533
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
176 " Define the default highlighting.
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
177 hi def link awkConditional Conditional
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
178 hi def link awkFunction Function
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
179 hi def link awkRepeat Repeat
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
180 hi def link awkStatement Statement
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
181 hi def link awkString String
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
182 hi def link awkSpecialPrintf Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
183 hi def link awkSpecialCharacter Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
184 hi def link awkSearch String
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
185 hi def link awkBrackets awkRegExp
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
186 hi def link awkBrktRegExp awkNestRegExp
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
187 hi def link awkCharClass awkNestRegExp
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
188 hi def link awkNestRegExp Keyword
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
189 hi def link awkRegExp Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
190 hi def link awkNumber Number
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
191 hi def link awkFloat Float
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
192 hi def link awkFileIO Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
193 hi def link awkOperator Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
194 hi def link awkExpression Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
195 hi def link awkBoolLogic Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
196 hi def link awkPatterns Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
197 hi def link awkVariables Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
198 hi def link awkFieldVars Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
199 hi def link awkLineSkip Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
200 hi def link awkSemicolon Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
201 hi def link awkComma Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
202 hi def link awkIdentifier Identifier
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
203 hi def link awkComment Comment
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
204 hi def link awkTodo Todo
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
205 " Change this if you want nested array names to be highlighted.
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
206 hi def link awkArrayArray awkArray
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
207 hi def link awkArrayElement Special
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
208 hi def link awkParenError awkError
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
209 hi def link awkInParen awkError
9f921133ee90 commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents: 6530
diff changeset
210 hi def link awkError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 let b:current_syntax = "awk"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 216
diff changeset
214 let &cpo = s:cpo_save
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 216
diff changeset
215 unlet s:cpo_save
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 216
diff changeset
216
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 " vim: ts=8