| 1 |
{ |
| 2 |
"fileTypes": ["awk"], |
| 3 |
"name": "awk", |
| 4 |
"patterns": [ |
| 5 |
{ |
| 6 |
"include": "#comment" |
| 7 |
}, |
| 8 |
{ |
| 9 |
"include": "#procedure" |
| 10 |
}, |
| 11 |
{ |
| 12 |
"include": "#pattern" |
| 13 |
} |
| 14 |
], |
| 15 |
"repository": { |
| 16 |
"builtin-pattern": { |
| 17 |
"match": "\\b(BEGINFILE|BEGIN|ENDFILE|END)\\b", |
| 18 |
"name": "constant.language.awk" |
| 19 |
}, |
| 20 |
"command": { |
| 21 |
"patterns": [ |
| 22 |
{ |
| 23 |
"match": "\\b(?:next|print|printf)\\b", |
| 24 |
"name": "keyword.other.command.awk" |
| 25 |
}, |
| 26 |
{ |
| 27 |
"match": "\\b(?:close|getline|delete|system)\\b", |
| 28 |
"name": "keyword.other.command.nawk" |
| 29 |
}, |
| 30 |
{ |
| 31 |
"match": "\\b(?:fflush|nextfile)\\b", |
| 32 |
"name": "keyword.other.command.bell-awk" |
| 33 |
} |
| 34 |
] |
| 35 |
}, |
| 36 |
"comment": { |
| 37 |
"match": "#.*", |
| 38 |
"name": "comment.line.number-sign.awk" |
| 39 |
}, |
| 40 |
"constant": { |
| 41 |
"patterns": [ |
| 42 |
{ |
| 43 |
"include": "#numeric-constant" |
| 44 |
}, |
| 45 |
{ |
| 46 |
"include": "#string-constant" |
| 47 |
} |
| 48 |
] |
| 49 |
}, |
| 50 |
"escaped-char": { |
| 51 |
"match": "\\\\(?:[\\\\abfnrtv/\"]|x[0-9A-Fa-f]{2}|[0-7]{3})", |
| 52 |
"name": "constant.character.escape.awk" |
| 53 |
}, |
| 54 |
"expression": { |
| 55 |
"patterns": [ |
| 56 |
{ |
| 57 |
"include": "#command" |
| 58 |
}, |
| 59 |
{ |
| 60 |
"include": "#function" |
| 61 |
}, |
| 62 |
{ |
| 63 |
"include": "#constant" |
| 64 |
}, |
| 65 |
{ |
| 66 |
"include": "#variable" |
| 67 |
}, |
| 68 |
{ |
| 69 |
"include": "#regexp-in-expression" |
| 70 |
}, |
| 71 |
{ |
| 72 |
"include": "#operator" |
| 73 |
}, |
| 74 |
{ |
| 75 |
"include": "#groupings" |
| 76 |
} |
| 77 |
] |
| 78 |
}, |
| 79 |
"function": { |
| 80 |
"patterns": [ |
| 81 |
{ |
| 82 |
"match": "\\b(?:exp|int|log|sqrt|index|length|split|sprintf|substr)\\b", |
| 83 |
"name": "support.function.awk" |
| 84 |
}, |
| 85 |
{ |
| 86 |
"match": "\\b(?:atan2|cos|rand|sin|srand|gsub|match|sub|tolower|toupper)\\b", |
| 87 |
"name": "support.function.nawk" |
| 88 |
}, |
| 89 |
{ |
| 90 |
"match": "\\b(?:gensub|strftime|systime)\\b", |
| 91 |
"name": "support.function.gawk" |
| 92 |
} |
| 93 |
] |
| 94 |
}, |
| 95 |
"function-definition": { |
| 96 |
"begin": "\\b(function)\\s+(\\w+)(\\()", |
| 97 |
"beginCaptures": { |
| 98 |
"1": { |
| 99 |
"name": "storage.type.function.awk" |
| 100 |
}, |
| 101 |
"2": { |
| 102 |
"name": "entity.name.function.awk" |
| 103 |
}, |
| 104 |
"3": { |
| 105 |
"name": "punctuation.definition.parameters.begin.awk" |
| 106 |
} |
| 107 |
}, |
| 108 |
"end": "\\)", |
| 109 |
"endCaptures": { |
| 110 |
"0": { |
| 111 |
"name": "punctuation.definition.parameters.end.awk" |
| 112 |
} |
| 113 |
}, |
| 114 |
"patterns": [ |
| 115 |
{ |
| 116 |
"match": "\\b(\\w+)\\b", |
| 117 |
"name": "variable.parameter.function.awk" |
| 118 |
}, |
| 119 |
{ |
| 120 |
"match": "\\b(,)\\b", |
| 121 |
"name": "punctuation.separator.parameters.awk" |
| 122 |
} |
| 123 |
] |
| 124 |
}, |
| 125 |
"groupings": { |
| 126 |
"patterns": [ |
| 127 |
{ |
| 128 |
"match": "\\(", |
| 129 |
"name": "meta.brace.round.awk" |
| 130 |
}, |
| 131 |
{ |
| 132 |
"match": "\\)", |
| 133 |
"name": "meta.brace.round.awk" |
| 134 |
}, |
| 135 |
{ |
| 136 |
"match": "\\,", |
| 137 |
"name": "punctuation.separator.parameters.awk" |
| 138 |
} |
| 139 |
] |
| 140 |
}, |
| 141 |
"keyword": { |
| 142 |
"match": "\\b(?:break|continue|do|while|exit|for|if|else|return)\\b", |
| 143 |
"name": "keyword.control.awk" |
| 144 |
}, |
| 145 |
"numeric-constant": { |
| 146 |
"match": "\\b[0-9]+(?:\\.[0-9]+)?(?:e[+-][0-9]+)?\\b", |
| 147 |
"name": "constant.numeric.awk" |
| 148 |
}, |
| 149 |
"operator": { |
| 150 |
"patterns": [ |
| 151 |
{ |
| 152 |
"match": "(!?~|[=<>!]=|[<>])", |
| 153 |
"name": "keyword.operator.comparison.awk" |
| 154 |
}, |
| 155 |
{ |
| 156 |
"match": "\\b(in)\\b", |
| 157 |
"name": "keyword.operator.comparison.awk" |
| 158 |
}, |
| 159 |
{ |
| 160 |
"match": "([+\\-*/%^]=|\\+\\+|--|>>|=)", |
| 161 |
"name": "keyword.operator.assignment.awk" |
| 162 |
}, |
| 163 |
{ |
| 164 |
"match": "(\\|\\||&&|!)", |
| 165 |
"name": "keyword.operator.boolean.awk" |
| 166 |
}, |
| 167 |
{ |
| 168 |
"match": "([+\\-*/%^])", |
| 169 |
"name": "keyword.operator.arithmetic.awk" |
| 170 |
}, |
| 171 |
{ |
| 172 |
"match": "([?:])", |
| 173 |
"name": "keyword.operator.trinary.awk" |
| 174 |
}, |
| 175 |
{ |
| 176 |
"match": "(\\[|\\])", |
| 177 |
"name": "keyword.operator.index.awk" |
| 178 |
} |
| 179 |
] |
| 180 |
}, |
| 181 |
"pattern": { |
| 182 |
"patterns": [ |
| 183 |
{ |
| 184 |
"include": "#regexp-as-pattern" |
| 185 |
}, |
| 186 |
{ |
| 187 |
"include": "#function-definition" |
| 188 |
}, |
| 189 |
{ |
| 190 |
"include": "#builtin-pattern" |
| 191 |
}, |
| 192 |
{ |
| 193 |
"include": "#expression" |
| 194 |
} |
| 195 |
] |
| 196 |
}, |
| 197 |
"procedure": { |
| 198 |
"begin": "\\{", |
| 199 |
"end": "\\}", |
| 200 |
"patterns": [ |
| 201 |
{ |
| 202 |
"include": "#comment" |
| 203 |
}, |
| 204 |
{ |
| 205 |
"include": "#procedure" |
| 206 |
}, |
| 207 |
{ |
| 208 |
"include": "#keyword" |
| 209 |
}, |
| 210 |
{ |
| 211 |
"include": "#expression" |
| 212 |
} |
| 213 |
] |
| 214 |
}, |
| 215 |
"regex-as-assignment": { |
| 216 |
"begin": "([^=<>!+\\-*/%^]=)\\s*(/)", |
| 217 |
"beginCaptures": { |
| 218 |
"1": { |
| 219 |
"name": "keyword.operator.assignment.awk" |
| 220 |
}, |
| 221 |
"2": { |
| 222 |
"name": "punctuation.definition.regex.begin.awk" |
| 223 |
} |
| 224 |
}, |
| 225 |
"contentName": "string.regexp", |
| 226 |
"end": "/", |
| 227 |
"endCaptures": { |
| 228 |
"0": { |
| 229 |
"name": "punctuation.definition.regex.end.awk" |
| 230 |
} |
| 231 |
}, |
| 232 |
"patterns": [ |
| 233 |
{ |
| 234 |
"include": "source.regexp" |
| 235 |
} |
| 236 |
] |
| 237 |
}, |
| 238 |
"regex-as-comparison": { |
| 239 |
"begin": "(!?~)\\s*(/)", |
| 240 |
"beginCaptures": { |
| 241 |
"1": { |
| 242 |
"name": "keyword.operator.comparison.awk" |
| 243 |
}, |
| 244 |
"2": { |
| 245 |
"name": "punctuation.definition.regex.begin.awk" |
| 246 |
} |
| 247 |
}, |
| 248 |
"contentName": "string.regexp", |
| 249 |
"end": "/", |
| 250 |
"endCaptures": { |
| 251 |
"0": { |
| 252 |
"name": "punctuation.definition.regex.end.awk" |
| 253 |
} |
| 254 |
}, |
| 255 |
"patterns": [ |
| 256 |
{ |
| 257 |
"include": "source.regexp" |
| 258 |
} |
| 259 |
] |
| 260 |
}, |
| 261 |
"regex-as-first-argument": { |
| 262 |
"begin": "(\\()\\s*(/)", |
| 263 |
"beginCaptures": { |
| 264 |
"1": { |
| 265 |
"name": "meta.brace.round.awk" |
| 266 |
}, |
| 267 |
"2": { |
| 268 |
"name": "punctuation.definition.regex.begin.awk" |
| 269 |
} |
| 270 |
}, |
| 271 |
"contentName": "string.regexp", |
| 272 |
"end": "/", |
| 273 |
"endCaptures": { |
| 274 |
"0": { |
| 275 |
"name": "punctuation.definition.regex.end.awk" |
| 276 |
} |
| 277 |
}, |
| 278 |
"patterns": [ |
| 279 |
{ |
| 280 |
"include": "source.regexp" |
| 281 |
} |
| 282 |
] |
| 283 |
}, |
| 284 |
"regex-as-nth-argument": { |
| 285 |
"begin": "(,)\\s*(/)", |
| 286 |
"beginCaptures": { |
| 287 |
"1": { |
| 288 |
"name": "punctuation.separator.parameters.awk" |
| 289 |
}, |
| 290 |
"2": { |
| 291 |
"name": "punctuation.definition.regex.begin.awk" |
| 292 |
} |
| 293 |
}, |
| 294 |
"contentName": "string.regexp", |
| 295 |
"end": "/", |
| 296 |
"endCaptures": { |
| 297 |
"0": { |
| 298 |
"name": "punctuation.definition.regex.end.awk" |
| 299 |
} |
| 300 |
}, |
| 301 |
"patterns": [ |
| 302 |
{ |
| 303 |
"include": "source.regexp" |
| 304 |
} |
| 305 |
] |
| 306 |
}, |
| 307 |
"regexp-as-pattern": { |
| 308 |
"begin": "/", |
| 309 |
"beginCaptures": { |
| 310 |
"0": { |
| 311 |
"name": "punctuation.definition.regex.begin.awk" |
| 312 |
} |
| 313 |
}, |
| 314 |
"contentName": "string.regexp", |
| 315 |
"end": "/", |
| 316 |
"endCaptures": { |
| 317 |
"0": { |
| 318 |
"name": "punctuation.definition.regex.end.awk" |
| 319 |
} |
| 320 |
}, |
| 321 |
"patterns": [ |
| 322 |
{ |
| 323 |
"include": "source.regexp" |
| 324 |
} |
| 325 |
] |
| 326 |
}, |
| 327 |
"regexp-in-expression": { |
| 328 |
"patterns": [ |
| 329 |
{ |
| 330 |
"include": "#regex-as-assignment" |
| 331 |
}, |
| 332 |
{ |
| 333 |
"include": "#regex-as-comparison" |
| 334 |
}, |
| 335 |
{ |
| 336 |
"include": "#regex-as-first-argument" |
| 337 |
}, |
| 338 |
{ |
| 339 |
"include": "#regex-as-nth-argument" |
| 340 |
} |
| 341 |
] |
| 342 |
}, |
| 343 |
"string-constant": { |
| 344 |
"begin": "\"", |
| 345 |
"beginCaptures": { |
| 346 |
"0": { |
| 347 |
"name": "punctuation.definition.string.begin.awk" |
| 348 |
} |
| 349 |
}, |
| 350 |
"end": "\"", |
| 351 |
"endCaptures": { |
| 352 |
"0": { |
| 353 |
"name": "punctuation.definition.string.end.awk" |
| 354 |
} |
| 355 |
}, |
| 356 |
"name": "string.quoted.double.awk", |
| 357 |
"patterns": [ |
| 358 |
{ |
| 359 |
"include": "#escaped-char" |
| 360 |
} |
| 361 |
] |
| 362 |
}, |
| 363 |
"variable": { |
| 364 |
"patterns": [ |
| 365 |
{ |
| 366 |
"match": "\\$[0-9]+", |
| 367 |
"name": "variable.language.awk" |
| 368 |
}, |
| 369 |
{ |
| 370 |
"match": "\\b(?:FILENAME|FS|NF|NR|OFMT|OFS|ORS|RS)\\b", |
| 371 |
"name": "variable.language.awk" |
| 372 |
}, |
| 373 |
{ |
| 374 |
"match": "\\b(?:ARGC|ARGV|CONVFMT|ENVIRON|FNR|RLENGTH|RSTART|SUBSEP)\\b", |
| 375 |
"name": "variable.language.nawk" |
| 376 |
}, |
| 377 |
{ |
| 378 |
"match": "\\b(?:ARGIND|ERRNO|FIELDWIDTHS|IGNORECASE|RT)\\b", |
| 379 |
"name": "variable.language.gawk" |
| 380 |
} |
| 381 |
] |
| 382 |
} |
| 383 |
}, |
| 384 |
"scopeName": "source.awk", |
| 385 |
"uuid": "67bd1ff0-006b-4c32-8b97-8bc198777582" |
| 386 |
} |
| 387 |
|