├── Comments.tmPreferences ├── LICENSE ├── README.md ├── nix.YAML-tmLanguage └── nix.tmLanguage /Comments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | source.nix 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | # 18 | 19 | 20 | 21 | uuid 22 | 858E140E-51E6-4863-829F-EF6B4B8FA816 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Wout Mertens 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | sublime-nix 2 | =========== 3 | 4 | [Nix](http://nixos.org) syntax highlighting for Sublime Text. 5 | 6 | This syntax tries to be complete, and marks illegal code as such. 7 | 8 | Unfortunately, the syntax highlighter in Sublime Text does not implement 9 | a full state machine and therefore this is an approximation of the actual 10 | syntax Nix allows. It's a bit looser and will mark things as illegal in corner 11 | cases. 12 | 13 | Specifically, it has to guess whether { starts an attribute set or a function 14 | call, and it can't look ahead to the next lines, so it allows both until it's sure. 15 | However, this means that on column 0 the expression end-condition 16 | can match on a , or } and this breaks the syntax highlighting. As soon as it 17 | is sure of one or the other, this no longer applies. So this is only applicable 18 | to empty {} and comma-first function calls on column 0, not a big problem. 19 | 20 | Tested against the nixpkgs code and the Nix test suite, it seems to render 21 | those ok. 22 | 23 | There is some fun code in here, approximating a proper parser by recursing 24 | into rules with end conditions matching end of expression. -------------------------------------------------------------------------------- /nix.YAML-tmLanguage: -------------------------------------------------------------------------------- 1 | # [PackageDev] target_format: plist, ext: tmLanguage 2 | # Made by Wout.Mertens@gmail.com 3 | # 4 | # This grammar tries to be complete, but regex-based highlighters 5 | # can't be full parsers. Therefore it's a bit looser than the Nix 6 | # parser itself and some legal constructs will be marked as illegal. 7 | # It seems to work fine for nixpkgs. 8 | # 9 | # 10 | # While reading this, bear in mind that multi-line matches are not 11 | # allowed and the end regex is tested before enclosed patterns regexes 12 | # However, you can look-ahead to an end pattern with (?=...), which allows 13 | # you to match everything in a block 14 | # 15 | # 16 | # To enforce multipart expressions, a wrapper pattern is used 17 | # that matches the beginning and end with look-ahead. 18 | # Then the parts are chained with look-aheads. 19 | # 20 | # Unfortunately this doesn't work if the end condition matches 21 | # the end of a part, in that case the part is fully matched 22 | # instead of with a look-ahead 23 | # and legal expressions should still match properly. 24 | # 25 | # Known issues: 26 | # - attrset: 27 | # - if the closing brace of an empty { } block is at column 1 28 | # of the line, it will terminate the expression and mark 29 | # expression-cont rules as invalid 30 | # 31 | # There are no named regexes, so here's a list for copy-paste: 32 | # identifier: [a-zA-Z\_][a-zA-Z0-9\_\'\-]* 33 | # expression terminator next: (?=([\])};,]|\b(else|then)\b)) 34 | # match anything coming next: (?=.?) 35 | # match until end of file: $^ 36 | 37 | --- 38 | name: Nix 39 | scopeName: source.nix 40 | fileTypes: [ "nix" ] 41 | uuid: 0514fd5f-acb6-436d-b42c-7643e6d36c8f 42 | 43 | patterns: 44 | - include: '#expression' 45 | 46 | repository: 47 | 48 | expression: 49 | patterns: 50 | - include: '#parens-and-cont' 51 | - include: '#list-and-cont' 52 | - include: '#string' 53 | - include: '#interpolation' 54 | - include: '#with-assert' 55 | - include: '#function-for-sure' 56 | - include: '#attrset-for-sure' 57 | - include: '#attrset-or-function' 58 | - include: '#let' 59 | - include: '#if' 60 | - include: '#operator-unary' 61 | - include: '#constants' 62 | - include: '#bad-reserved' 63 | - include: '#parameter-name-and-cont' 64 | - include: '#others' 65 | expression-cont: 66 | begin: (?=.?) 67 | end: (?=([\])};,]|\b(else|then)\b)) 68 | patterns: 69 | - include: '#parens' 70 | - include: '#list' 71 | - include: '#string' 72 | - include: '#interpolation' 73 | - include: '#function-for-sure' 74 | - include: '#attrset-for-sure' 75 | - include: '#attrset-or-function' 76 | - name: keyword.operator.nix 77 | match: (\bor\b|\.|==|!=|!|\<\=|\<|\>\=|\>|&&|\|\||-\>|//|\?|\+\+|\|>|-|\*|/(?=([^*]|$))|\+) 78 | - include: '#constants' 79 | - include: '#bad-reserved' 80 | - include: '#parameter-name' 81 | - include: '#others' 82 | 83 | parens: 84 | begin: \( 85 | beginCaptures: 86 | '0': {name: punctuation.definition.expression.nix } 87 | end: \) 88 | endCaptures: 89 | '0': {name: punctuation.definition.expression.nix } 90 | patterns: 91 | - include: '#expression' 92 | parens-and-cont: 93 | begin: (?=\() 94 | end: (?=([\])};,]|\b(else|then)\b)) 95 | patterns: 96 | - include: '#parens' 97 | - include: '#expression-cont' 98 | 99 | list: 100 | begin: \[ 101 | beginCaptures: 102 | '0': {name: punctuation.definition.list.nix } 103 | end: \] 104 | endCaptures: 105 | '0': {name: punctuation.definition.list.nix } 106 | patterns: 107 | - include: '#expression' 108 | list-and-cont: 109 | begin: (?=\[) 110 | end: (?=([\])};,]|\b(else|then)\b)) 111 | patterns: 112 | - include: '#list' 113 | - include: '#expression-cont' 114 | 115 | attrset-for-sure: 116 | patterns: 117 | - begin: (?=\brec\b) 118 | end: (?=([\])};,]|\b(else|then)\b)) 119 | patterns: 120 | - begin: \brec\b 121 | end: (?=\{) 122 | beginCaptures: 123 | '0': {name: keyword.other.nix} 124 | patterns: 125 | - include: '#others' 126 | - include: '#attrset-definition' 127 | - include: '#others' 128 | - begin: (?=\{\s*(\}|[^,?]*(=|;))) 129 | end: (?=([\])};,]|\b(else|then)\b)) 130 | patterns: 131 | - include: '#attrset-definition' 132 | - include: '#others' 133 | 134 | attrset-definition: 135 | begin: (?=\{) 136 | end: (?=([\])};,]|\b(else|then)\b)) 137 | patterns: 138 | - begin: (\{) 139 | end: (\}) 140 | beginCaptures: {"0":{name: punctuation.definition.attrset.nix}} 141 | endCaptures: {"0":{name: punctuation.definition.attrset.nix}} 142 | patterns: 143 | - include: '#attrset-contents' 144 | - begin: (?<=\}) 145 | end: (?=([\])};,]|\b(else|then)\b)) 146 | patterns: 147 | - include: '#expression-cont' 148 | attrset-definition-brace-opened: 149 | patterns: 150 | - begin: (?<=\}) 151 | end: (?=([\])};,]|\b(else|then)\b)) 152 | patterns: 153 | - include: '#expression-cont' 154 | - begin: (?=.?) 155 | end: \} 156 | endCaptures: {"0":{name: punctuation.definition.attrset.nix}} 157 | patterns: 158 | - include: '#attrset-contents' 159 | 160 | attrset-contents: 161 | patterns: 162 | - include: '#attribute-inherit' 163 | - include: '#bad-reserved' 164 | - include: '#attribute-bind' 165 | - include: '#others' 166 | 167 | function-header-open-brace: 168 | begin: \{ 169 | end: (?=\}) 170 | beginCaptures: 171 | '0': {name: punctuation.definition.entity.function.2.nix} 172 | patterns: 173 | - include: '#function-contents' 174 | function-header-close-brace-no-arg: 175 | begin: \} 176 | end: (?=\:) 177 | beginCaptures: 178 | '0': {name: punctuation.definition.entity.function.nix} 179 | patterns: 180 | - include: '#others' 181 | function-header-terminal-arg: 182 | begin: (?=@) 183 | end: (?=\:) 184 | patterns: 185 | - begin: \@ 186 | end: (?=\:) 187 | patterns: 188 | - begin: (\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*) 189 | end: (?=\:) 190 | name: variable.parameter.function.3.nix 191 | - include: '#others' 192 | - include: '#others' 193 | function-header-close-brace-with-arg: 194 | begin: \} 195 | end: (?=\:) 196 | beginCaptures: 197 | '0': {name: punctuation.definition.entity.function.nix} 198 | patterns: 199 | - include: '#function-header-terminal-arg' 200 | - include: '#others' 201 | function-header-until-colon-no-arg: 202 | begin: (?=\{) 203 | end: (?=\:) 204 | patterns: 205 | - include: '#function-header-open-brace' 206 | - include: '#function-header-close-brace-no-arg' 207 | function-header-until-colon-with-arg: 208 | begin: (?=\{) 209 | end: (?=\:) 210 | patterns: 211 | - include: '#function-header-open-brace' 212 | - include: '#function-header-close-brace-with-arg' 213 | function-body-from-colon: 214 | begin: (\:) 215 | end: (?=([\])};,]|\b(else|then)\b)) 216 | beginCaptures: 217 | '0': {name: punctuation.definition.function.nix} 218 | patterns: 219 | - include: '#expression' 220 | function-definition: 221 | begin: (?=.?) 222 | end: (?=([\])};,]|\b(else|then)\b)) 223 | patterns: 224 | - include: '#function-body-from-colon' 225 | # Chained expressions for [arg@]{a,b,c?xxx}[@arg]:yyy 226 | - begin: (?=.?) 227 | end: (?=\:) 228 | patterns: 229 | # arg @ { ... 230 | - begin: (\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*) 231 | end: (?=\:) 232 | beginCaptures: 233 | '0': {name: variable.parameter.function.4.nix} 234 | patterns: 235 | - begin: \@ 236 | end: (?=\:) 237 | patterns: 238 | - include: '#function-header-until-colon-no-arg' 239 | - include: '#others' 240 | - include: '#others' 241 | # { ... 242 | - begin: (?=\{) 243 | end: (?=\:) 244 | patterns: 245 | - include: '#function-header-until-colon-with-arg' 246 | - include: '#others' 247 | function-definition-brace-opened: 248 | begin: (?=.?) 249 | end: (?=([\])};,]|\b(else|then)\b)) 250 | patterns: 251 | - include: '#function-body-from-colon' 252 | # Chained expressions for a,b,c?xxx}[@arg]:yyy 253 | - begin: (?=.?) 254 | end: (?=\:) 255 | patterns: 256 | - include: '#function-header-close-brace-with-arg' 257 | - begin: (?=.?) 258 | end: (?=\}) 259 | patterns: 260 | - include: '#function-contents' 261 | - include: '#others' 262 | 263 | function-for-sure: 264 | patterns: 265 | # x: ... | {stuff}: ... | {a, b ? c, ... | arg @ {... 266 | - begin: (?=(\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*\s*[:@]|\{[^}]*\}\s*:|\{[^#}"'/=]*[,\?])) 267 | end: (?=([\])};,]|\b(else|then)\b)) 268 | patterns: 269 | - include: '#function-definition' 270 | 271 | function-contents: 272 | patterns: 273 | - include: '#bad-reserved' 274 | - include: '#function-parameter' 275 | - include: '#others' 276 | 277 | attrset-or-function: 278 | begin: \{ 279 | beginCaptures: 280 | '0': {name: punctuation.definition.attrset-or-function.nix} 281 | # Note the absence of a comma here, otherwise comma-first fails 282 | end: (?=([\])};]|\b(else|then)\b)) 283 | patterns: 284 | # We have no clue what to expect so we allow both until we hit one 285 | # attrset contents => treat the rest as attrset 286 | - begin: (?=(\s*\}|\"|\binherit\b|\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*(\s*\.|\s*=[^=]))) 287 | end: (?=([\])};,]|\b(else|then)\b)) 288 | patterns: 289 | - include: '#attrset-definition-brace-opened' 290 | # function contents => treat the rest as function header 291 | - begin: (?=(\.\.\.|\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*\s*[,?])) 292 | end: (?=([\])};,]|\b(else|then)\b)) 293 | patterns: 294 | - include: '#function-definition-brace-opened' 295 | # this line has no hints, eat the first word of the set 296 | - include: '#bad-reserved' 297 | - begin: \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 298 | # Note the absence of a comma here, otherwise comma-first fails 299 | end: (?=([\])};]|\b(else|then)\b)) 300 | # unmatched first word is likely a function call 301 | beginCaptures: {'0': {name: variable.parameter.function.maybe.nix}} 302 | patterns: 303 | - begin: (?=\.) 304 | end: (?=([\])};,]|\b(else|then)\b)) 305 | patterns: 306 | - include: '#attrset-definition-brace-opened' 307 | # Note the \s*, this matches before the end-of-expr matches except at beginning 308 | - begin: \s*(\,) 309 | beginCaptures: {'1': {name: keyword.operator.nix}} 310 | end: (?=([\])};,]|\b(else|then)\b)) 311 | patterns: 312 | - include: '#function-definition-brace-opened' 313 | - begin: (?=\=) 314 | end: (?=([\])};,]|\b(else|then)\b)) 315 | patterns: 316 | - include: '#attribute-bind-from-equals' 317 | - include: '#attrset-definition-brace-opened' 318 | - begin: (?=\?) 319 | end: (?=([\])};,]|\b(else|then)\b)) 320 | patterns: 321 | - include: '#function-parameter-default' 322 | - begin: \, 323 | beginCaptures: 324 | '0': {name: keyword.operator.nix} 325 | end: (?=([\])};,]|\b(else|then)\b)) 326 | patterns: 327 | - include: '#function-definition-brace-opened' 328 | - include: '#others' 329 | - include: '#others' 330 | 331 | with-assert: 332 | begin: (?) 464 | beginCaptures: {"0": {name: string.unquoted.spath.nix}} 465 | end: (?=([\])};,]|\b(else|then)\b)) 466 | patterns: 467 | - include: '#expression-cont' 468 | - begin: ([a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']+) 469 | beginCaptures: {"0": {name: string.unquoted.url.nix}} 470 | end: (?=([\])};,]|\b(else|then)\b)) 471 | patterns: 472 | - include: '#expression-cont' 473 | 474 | parameter-name: 475 | match: \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 476 | captures: {"0":{name: variable.parameter.name.nix}} 477 | 478 | parameter-name-and-cont: 479 | begin: \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 480 | end: (?=([\])};,]|\b(else|then)\b)) 481 | beginCaptures: {"0":{name: variable.parameter.name.nix}} 482 | patterns: 483 | - include: '#expression-cont' 484 | 485 | attribute-name-single: 486 | match: \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 487 | name: entity.other.attribute-name.single.nix 488 | 489 | attribute-name: 490 | # Unfortunately, no pattern ordering can be enforced. Ah well. 491 | patterns: 492 | - match: \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 493 | name: entity.other.attribute-name.multipart.nix 494 | - match: \. 495 | - include: '#string-quoted' 496 | - include: '#interpolation' 497 | 498 | function-parameter-default: 499 | begin: \? 500 | beginCaptures: 501 | '0': {name: keyword.operator.nix} 502 | end: (?=[,}]) 503 | patterns: 504 | - include: '#expression' 505 | function-parameter: 506 | patterns: 507 | - begin: (\.\.\.) 508 | end: (,|(?=\})) 509 | name: keyword.operator.nix 510 | patterns: 511 | - include: '#others' 512 | - begin: \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 513 | beginCaptures: 514 | '0': {name: variable.parameter.function.1.nix} 515 | end: (,|(?=\})) 516 | endCaptures: 517 | '0': {name: keyword.operator.nix} 518 | patterns: 519 | - include: '#whitespace' 520 | - include: '#comment' 521 | - include: '#function-parameter-default' 522 | - include: '#expression' 523 | - include: '#others' 524 | 525 | attribute-inherit: 526 | begin: \binherit\b 527 | beginCaptures: {'0': {name: keyword.other.inherit.nix}} 528 | end: \; 529 | endCaptures: {'0': {name: punctuation.terminator.inherit.nix}} 530 | patterns: 531 | # This should only match once, in front. Ah well. 532 | - begin: \( 533 | end: (?=\;) 534 | beginCaptures: {'0': {name: punctuation.section.function.arguments.nix}} 535 | patterns: 536 | - begin: \) 537 | end: (?=\;) 538 | beginCaptures: {'0': {name: punctuation.section.function.arguments.nix}} 539 | patterns: 540 | - include: '#bad-reserved' 541 | - include: '#attribute-name-single' 542 | - include: '#others' 543 | - include: '#expression' 544 | - begin: (?=[a-zA-Z\_]) 545 | end: (?=\;) 546 | patterns: 547 | - include: '#bad-reserved' 548 | - include: '#attribute-name-single' 549 | - include: '#others' 550 | - include: '#others' 551 | 552 | attribute-bind-from-equals: 553 | begin: \= 554 | beginCaptures: 555 | '0': {name: keyword.operator.bind.nix} 556 | end: \; 557 | endCaptures: 558 | '0': {name: punctuation.terminator.bind.nix} 559 | patterns: 560 | - include: '#expression' 561 | attribute-bind: 562 | patterns: 563 | - include: '#attribute-name' 564 | # Wish this could match only after an attribute. Ah well. 565 | - include: '#attribute-bind-from-equals' 566 | 567 | operator-unary: 568 | name: keyword.operator.unary.nix 569 | match: (!|-) 570 | 571 | constants: 572 | patterns: 573 | - begin: \b(builtins|true|false|null)\b 574 | end: (?=([\])};,]|\b(else|then)\b)) 575 | beginCaptures: 576 | '0': {name: constant.language.nix} 577 | patterns: 578 | - include: '#expression-cont' 579 | - beginCaptures: {"0":{name: support.function.nix}} 580 | begin: \b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\b 581 | end: (?=([\])};,]|\b(else|then)\b)) 582 | patterns: 583 | - include: '#expression-cont' 584 | - beginCaptures: {"0":{name: constant.numeric.nix}} 585 | begin: \b[0-9]+\b 586 | end: (?=([\])};,]|\b(else|then)\b)) 587 | patterns: 588 | - include: '#expression-cont' 589 | 590 | whitespace: 591 | match: \s+ 592 | 593 | illegal: 594 | match: . 595 | name: invalid.illegal 596 | 597 | others: 598 | patterns: 599 | - include: '#whitespace' 600 | - include: '#comment' 601 | - include: '#illegal' 602 | 603 | bad-reserved: 604 | # we don't mark "or" because it's a special case 605 | match: (? 2 | 3 | 4 | 5 | fileTypes 6 | 7 | nix 8 | 9 | name 10 | Nix 11 | patterns 12 | 13 | 14 | include 15 | #expression 16 | 17 | 18 | repository 19 | 20 | attribute-bind 21 | 22 | patterns 23 | 24 | 25 | include 26 | #attribute-name 27 | 28 | 29 | include 30 | #attribute-bind-from-equals 31 | 32 | 33 | 34 | attribute-bind-from-equals 35 | 36 | begin 37 | \= 38 | beginCaptures 39 | 40 | 0 41 | 42 | name 43 | keyword.operator.bind.nix 44 | 45 | 46 | end 47 | \; 48 | endCaptures 49 | 50 | 0 51 | 52 | name 53 | punctuation.terminator.bind.nix 54 | 55 | 56 | patterns 57 | 58 | 59 | include 60 | #expression 61 | 62 | 63 | 64 | attribute-inherit 65 | 66 | begin 67 | \binherit\b 68 | beginCaptures 69 | 70 | 0 71 | 72 | name 73 | keyword.other.inherit.nix 74 | 75 | 76 | end 77 | \; 78 | endCaptures 79 | 80 | 0 81 | 82 | name 83 | punctuation.terminator.inherit.nix 84 | 85 | 86 | patterns 87 | 88 | 89 | begin 90 | \( 91 | beginCaptures 92 | 93 | 0 94 | 95 | name 96 | punctuation.section.function.arguments.nix 97 | 98 | 99 | end 100 | (?=\;) 101 | patterns 102 | 103 | 104 | begin 105 | \) 106 | beginCaptures 107 | 108 | 0 109 | 110 | name 111 | punctuation.section.function.arguments.nix 112 | 113 | 114 | end 115 | (?=\;) 116 | patterns 117 | 118 | 119 | include 120 | #bad-reserved 121 | 122 | 123 | include 124 | #attribute-name-single 125 | 126 | 127 | include 128 | #others 129 | 130 | 131 | 132 | 133 | include 134 | #expression 135 | 136 | 137 | 138 | 139 | begin 140 | (?=[a-zA-Z\_]) 141 | end 142 | (?=\;) 143 | patterns 144 | 145 | 146 | include 147 | #bad-reserved 148 | 149 | 150 | include 151 | #attribute-name-single 152 | 153 | 154 | include 155 | #others 156 | 157 | 158 | 159 | 160 | include 161 | #others 162 | 163 | 164 | 165 | attribute-name 166 | 167 | patterns 168 | 169 | 170 | match 171 | \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 172 | name 173 | entity.other.attribute-name.multipart.nix 174 | 175 | 176 | match 177 | \. 178 | 179 | 180 | include 181 | #string-quoted 182 | 183 | 184 | include 185 | #interpolation 186 | 187 | 188 | 189 | attribute-name-single 190 | 191 | match 192 | \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 193 | name 194 | entity.other.attribute-name.single.nix 195 | 196 | attrset-contents 197 | 198 | patterns 199 | 200 | 201 | include 202 | #attribute-inherit 203 | 204 | 205 | include 206 | #bad-reserved 207 | 208 | 209 | include 210 | #attribute-bind 211 | 212 | 213 | include 214 | #others 215 | 216 | 217 | 218 | attrset-definition 219 | 220 | begin 221 | (?=\{) 222 | end 223 | (?=([\])};,]|\b(else|then)\b)) 224 | patterns 225 | 226 | 227 | begin 228 | (\{) 229 | beginCaptures 230 | 231 | 0 232 | 233 | name 234 | punctuation.definition.attrset.nix 235 | 236 | 237 | end 238 | (\}) 239 | endCaptures 240 | 241 | 0 242 | 243 | name 244 | punctuation.definition.attrset.nix 245 | 246 | 247 | patterns 248 | 249 | 250 | include 251 | #attrset-contents 252 | 253 | 254 | 255 | 256 | begin 257 | (?<=\}) 258 | end 259 | (?=([\])};,]|\b(else|then)\b)) 260 | patterns 261 | 262 | 263 | include 264 | #expression-cont 265 | 266 | 267 | 268 | 269 | 270 | attrset-definition-brace-opened 271 | 272 | patterns 273 | 274 | 275 | begin 276 | (?<=\}) 277 | end 278 | (?=([\])};,]|\b(else|then)\b)) 279 | patterns 280 | 281 | 282 | include 283 | #expression-cont 284 | 285 | 286 | 287 | 288 | begin 289 | (?=.?) 290 | end 291 | \} 292 | endCaptures 293 | 294 | 0 295 | 296 | name 297 | punctuation.definition.attrset.nix 298 | 299 | 300 | patterns 301 | 302 | 303 | include 304 | #attrset-contents 305 | 306 | 307 | 308 | 309 | 310 | attrset-for-sure 311 | 312 | patterns 313 | 314 | 315 | begin 316 | (?=\brec\b) 317 | end 318 | (?=([\])};,]|\b(else|then)\b)) 319 | patterns 320 | 321 | 322 | begin 323 | \brec\b 324 | beginCaptures 325 | 326 | 0 327 | 328 | name 329 | keyword.other.nix 330 | 331 | 332 | end 333 | (?=\{) 334 | patterns 335 | 336 | 337 | include 338 | #others 339 | 340 | 341 | 342 | 343 | include 344 | #attrset-definition 345 | 346 | 347 | include 348 | #others 349 | 350 | 351 | 352 | 353 | begin 354 | (?=\{\s*(\}|[^,?]*(=|;))) 355 | end 356 | (?=([\])};,]|\b(else|then)\b)) 357 | patterns 358 | 359 | 360 | include 361 | #attrset-definition 362 | 363 | 364 | include 365 | #others 366 | 367 | 368 | 369 | 370 | 371 | attrset-or-function 372 | 373 | begin 374 | \{ 375 | beginCaptures 376 | 377 | 0 378 | 379 | name 380 | punctuation.definition.attrset-or-function.nix 381 | 382 | 383 | end 384 | (?=([\])};]|\b(else|then)\b)) 385 | patterns 386 | 387 | 388 | begin 389 | (?=(\s*\}|\"|\binherit\b|\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*(\s*\.|\s*=[^=])|\$\{[a-zA-z0-9\_\'\-]+\}(\s*\.|\s*=[^=]))) 390 | end 391 | (?=([\])};,]|\b(else|then)\b)) 392 | patterns 393 | 394 | 395 | include 396 | #attrset-definition-brace-opened 397 | 398 | 399 | 400 | 401 | begin 402 | (?=(\.\.\.|\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*\s*[,?])) 403 | end 404 | (?=([\])};,]|\b(else|then)\b)) 405 | patterns 406 | 407 | 408 | include 409 | #function-definition-brace-opened 410 | 411 | 412 | 413 | 414 | include 415 | #bad-reserved 416 | 417 | 418 | begin 419 | \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 420 | beginCaptures 421 | 422 | 0 423 | 424 | name 425 | variable.parameter.function.maybe.nix 426 | 427 | 428 | end 429 | (?=([\])};]|\b(else|then)\b)) 430 | patterns 431 | 432 | 433 | begin 434 | (?=\.) 435 | end 436 | (?=([\])};,]|\b(else|then)\b)) 437 | patterns 438 | 439 | 440 | include 441 | #attrset-definition-brace-opened 442 | 443 | 444 | 445 | 446 | begin 447 | \s*(\,) 448 | beginCaptures 449 | 450 | 1 451 | 452 | name 453 | keyword.operator.nix 454 | 455 | 456 | end 457 | (?=([\])};,]|\b(else|then)\b)) 458 | patterns 459 | 460 | 461 | include 462 | #function-definition-brace-opened 463 | 464 | 465 | 466 | 467 | begin 468 | (?=\=) 469 | end 470 | (?=([\])};,]|\b(else|then)\b)) 471 | patterns 472 | 473 | 474 | include 475 | #attribute-bind-from-equals 476 | 477 | 478 | include 479 | #attrset-definition-brace-opened 480 | 481 | 482 | 483 | 484 | begin 485 | (?=\?) 486 | end 487 | (?=([\])};,]|\b(else|then)\b)) 488 | patterns 489 | 490 | 491 | include 492 | #function-parameter-default 493 | 494 | 495 | begin 496 | \, 497 | beginCaptures 498 | 499 | 0 500 | 501 | name 502 | keyword.operator.nix 503 | 504 | 505 | end 506 | (?=([\])};,]|\b(else|then)\b)) 507 | patterns 508 | 509 | 510 | include 511 | #function-definition-brace-opened 512 | 513 | 514 | 515 | 516 | 517 | 518 | include 519 | #others 520 | 521 | 522 | 523 | 524 | include 525 | #others 526 | 527 | 528 | 529 | bad-reserved 530 | 531 | match 532 | (?<![\w'-])(if|then|else|assert|with|let|in|rec|inherit)(?![\w'-]) 533 | name 534 | invalid.illegal.reserved.nix 535 | 536 | comment 537 | 538 | patterns 539 | 540 | 541 | begin 542 | /\*([^*]|\*[^\/])* 543 | end 544 | \*\/ 545 | name 546 | comment.block.nix 547 | patterns 548 | 549 | 550 | include 551 | #comment-remark 552 | 553 | 554 | 555 | 556 | begin 557 | \# 558 | end 559 | $ 560 | name 561 | comment.line.number-sign.nix 562 | patterns 563 | 564 | 565 | include 566 | #comment-remark 567 | 568 | 569 | 570 | 571 | 572 | comment-remark 573 | 574 | captures 575 | 576 | 1 577 | 578 | name 579 | markup.bold.comment.nix 580 | 581 | 582 | match 583 | (TODO|FIXME|BUG|\!\!\!):? 584 | 585 | constants 586 | 587 | patterns 588 | 589 | 590 | begin 591 | \b(builtins|true|false|null)\b 592 | beginCaptures 593 | 594 | 0 595 | 596 | name 597 | constant.language.nix 598 | 599 | 600 | end 601 | (?=([\])};,]|\b(else|then)\b)) 602 | patterns 603 | 604 | 605 | include 606 | #expression-cont 607 | 608 | 609 | 610 | 611 | begin 612 | \b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\b 613 | beginCaptures 614 | 615 | 0 616 | 617 | name 618 | support.function.nix 619 | 620 | 621 | end 622 | (?=([\])};,]|\b(else|then)\b)) 623 | patterns 624 | 625 | 626 | include 627 | #expression-cont 628 | 629 | 630 | 631 | 632 | begin 633 | \b[0-9]+\b 634 | beginCaptures 635 | 636 | 0 637 | 638 | name 639 | constant.numeric.nix 640 | 641 | 642 | end 643 | (?=([\])};,]|\b(else|then)\b)) 644 | patterns 645 | 646 | 647 | include 648 | #expression-cont 649 | 650 | 651 | 652 | 653 | 654 | expression 655 | 656 | patterns 657 | 658 | 659 | include 660 | #parens-and-cont 661 | 662 | 663 | include 664 | #list-and-cont 665 | 666 | 667 | include 668 | #string 669 | 670 | 671 | include 672 | #interpolation 673 | 674 | 675 | include 676 | #with-assert 677 | 678 | 679 | include 680 | #function-for-sure 681 | 682 | 683 | include 684 | #attrset-for-sure 685 | 686 | 687 | include 688 | #attrset-or-function 689 | 690 | 691 | include 692 | #let 693 | 694 | 695 | include 696 | #if 697 | 698 | 699 | include 700 | #operator-unary 701 | 702 | 703 | include 704 | #constants 705 | 706 | 707 | include 708 | #bad-reserved 709 | 710 | 711 | include 712 | #parameter-name-and-cont 713 | 714 | 715 | include 716 | #others 717 | 718 | 719 | 720 | expression-cont 721 | 722 | begin 723 | (?=.?) 724 | end 725 | (?=([\])};,]|\b(else|then)\b)) 726 | patterns 727 | 728 | 729 | include 730 | #parens 731 | 732 | 733 | include 734 | #list 735 | 736 | 737 | include 738 | #string 739 | 740 | 741 | include 742 | #interpolation 743 | 744 | 745 | include 746 | #function-for-sure 747 | 748 | 749 | include 750 | #attrset-for-sure 751 | 752 | 753 | include 754 | #attrset-or-function 755 | 756 | 757 | match 758 | (\bor\b|\.|==|!=|!|\<\=|\<|\>\=|\>|&&|\|\||-\>|//|\?|\+\+|\|>|-|\*|/(?=([^*]|$))|\+) 759 | name 760 | keyword.operator.nix 761 | 762 | 763 | include 764 | #constants 765 | 766 | 767 | include 768 | #bad-reserved 769 | 770 | 771 | include 772 | #parameter-name 773 | 774 | 775 | include 776 | #others 777 | 778 | 779 | 780 | function-body 781 | 782 | begin 783 | (@\s*([a-zA-Z\_][a-zA-Z0-9\_\'\-]*)\s*)?(\:) 784 | end 785 | (?=([\])};,]|\b(else|then)\b)) 786 | patterns 787 | 788 | 789 | include 790 | #expression 791 | 792 | 793 | 794 | function-body-from-colon 795 | 796 | begin 797 | (\:) 798 | beginCaptures 799 | 800 | 0 801 | 802 | name 803 | punctuation.definition.function.nix 804 | 805 | 806 | end 807 | (?=([\])};,]|\b(else|then)\b)) 808 | patterns 809 | 810 | 811 | include 812 | #expression 813 | 814 | 815 | 816 | function-contents 817 | 818 | patterns 819 | 820 | 821 | include 822 | #bad-reserved 823 | 824 | 825 | include 826 | #function-parameter 827 | 828 | 829 | include 830 | #others 831 | 832 | 833 | 834 | function-definition 835 | 836 | begin 837 | (?=.?) 838 | end 839 | (?=([\])};,]|\b(else|then)\b)) 840 | patterns 841 | 842 | 843 | include 844 | #function-body-from-colon 845 | 846 | 847 | begin 848 | (?=.?) 849 | end 850 | (?=\:) 851 | patterns 852 | 853 | 854 | begin 855 | (\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*) 856 | beginCaptures 857 | 858 | 0 859 | 860 | name 861 | variable.parameter.function.4.nix 862 | 863 | 864 | end 865 | (?=\:) 866 | patterns 867 | 868 | 869 | begin 870 | \@ 871 | end 872 | (?=\:) 873 | patterns 874 | 875 | 876 | include 877 | #function-header-until-colon-no-arg 878 | 879 | 880 | include 881 | #others 882 | 883 | 884 | 885 | 886 | include 887 | #others 888 | 889 | 890 | 891 | 892 | begin 893 | (?=\{) 894 | end 895 | (?=\:) 896 | patterns 897 | 898 | 899 | include 900 | #function-header-until-colon-with-arg 901 | 902 | 903 | 904 | 905 | 906 | 907 | include 908 | #others 909 | 910 | 911 | 912 | function-definition-brace-opened 913 | 914 | begin 915 | (?=.?) 916 | end 917 | (?=([\])};,]|\b(else|then)\b)) 918 | patterns 919 | 920 | 921 | include 922 | #function-body-from-colon 923 | 924 | 925 | begin 926 | (?=.?) 927 | end 928 | (?=\:) 929 | patterns 930 | 931 | 932 | include 933 | #function-header-close-brace-with-arg 934 | 935 | 936 | begin 937 | (?=.?) 938 | end 939 | (?=\}) 940 | patterns 941 | 942 | 943 | include 944 | #function-contents 945 | 946 | 947 | 948 | 949 | 950 | 951 | include 952 | #others 953 | 954 | 955 | 956 | function-for-sure 957 | 958 | patterns 959 | 960 | 961 | begin 962 | (?=(\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*\s*[:@]|\{[^}]*\}\s*:|\{[^#}"'/=]*[,\?])) 963 | end 964 | (?=([\])};,]|\b(else|then)\b)) 965 | patterns 966 | 967 | 968 | include 969 | #function-definition 970 | 971 | 972 | 973 | 974 | 975 | function-header-close-brace-no-arg 976 | 977 | begin 978 | \} 979 | beginCaptures 980 | 981 | 0 982 | 983 | name 984 | punctuation.definition.entity.function.nix 985 | 986 | 987 | end 988 | (?=\:) 989 | patterns 990 | 991 | 992 | include 993 | #others 994 | 995 | 996 | 997 | function-header-close-brace-with-arg 998 | 999 | begin 1000 | \} 1001 | beginCaptures 1002 | 1003 | 0 1004 | 1005 | name 1006 | punctuation.definition.entity.function.nix 1007 | 1008 | 1009 | end 1010 | (?=\:) 1011 | patterns 1012 | 1013 | 1014 | include 1015 | #function-header-terminal-arg 1016 | 1017 | 1018 | include 1019 | #others 1020 | 1021 | 1022 | 1023 | function-header-open-brace 1024 | 1025 | begin 1026 | \{ 1027 | beginCaptures 1028 | 1029 | 0 1030 | 1031 | name 1032 | punctuation.definition.entity.function.2.nix 1033 | 1034 | 1035 | end 1036 | (?=\}) 1037 | patterns 1038 | 1039 | 1040 | include 1041 | #function-contents 1042 | 1043 | 1044 | 1045 | function-header-terminal-arg 1046 | 1047 | begin 1048 | (?=@) 1049 | end 1050 | (?=\:) 1051 | patterns 1052 | 1053 | 1054 | begin 1055 | \@ 1056 | end 1057 | (?=\:) 1058 | patterns 1059 | 1060 | 1061 | begin 1062 | (\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*) 1063 | end 1064 | (?=\:) 1065 | name 1066 | variable.parameter.function.3.nix 1067 | 1068 | 1069 | include 1070 | #others 1071 | 1072 | 1073 | 1074 | 1075 | include 1076 | #others 1077 | 1078 | 1079 | 1080 | function-header-until-colon-no-arg 1081 | 1082 | begin 1083 | (?=\{) 1084 | end 1085 | (?=\:) 1086 | patterns 1087 | 1088 | 1089 | include 1090 | #function-header-open-brace 1091 | 1092 | 1093 | include 1094 | #function-header-close-brace-no-arg 1095 | 1096 | 1097 | 1098 | function-header-until-colon-with-arg 1099 | 1100 | begin 1101 | (?=\{) 1102 | end 1103 | (?=\:) 1104 | patterns 1105 | 1106 | 1107 | include 1108 | #function-header-open-brace 1109 | 1110 | 1111 | include 1112 | #function-header-close-brace-with-arg 1113 | 1114 | 1115 | 1116 | function-parameter 1117 | 1118 | patterns 1119 | 1120 | 1121 | begin 1122 | (\.\.\.) 1123 | end 1124 | (,|(?=\})) 1125 | name 1126 | keyword.operator.nix 1127 | patterns 1128 | 1129 | 1130 | include 1131 | #others 1132 | 1133 | 1134 | 1135 | 1136 | begin 1137 | \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 1138 | beginCaptures 1139 | 1140 | 0 1141 | 1142 | name 1143 | variable.parameter.function.1.nix 1144 | 1145 | 1146 | end 1147 | (,|(?=\})) 1148 | endCaptures 1149 | 1150 | 0 1151 | 1152 | name 1153 | keyword.operator.nix 1154 | 1155 | 1156 | patterns 1157 | 1158 | 1159 | include 1160 | #whitespace 1161 | 1162 | 1163 | include 1164 | #comment 1165 | 1166 | 1167 | include 1168 | #function-parameter-default 1169 | 1170 | 1171 | include 1172 | #expression 1173 | 1174 | 1175 | 1176 | 1177 | include 1178 | #others 1179 | 1180 | 1181 | 1182 | function-parameter-default 1183 | 1184 | begin 1185 | \? 1186 | beginCaptures 1187 | 1188 | 0 1189 | 1190 | name 1191 | keyword.operator.nix 1192 | 1193 | 1194 | end 1195 | (?=[,}]) 1196 | patterns 1197 | 1198 | 1199 | include 1200 | #expression 1201 | 1202 | 1203 | 1204 | if 1205 | 1206 | begin 1207 | (?=\bif\b) 1208 | end 1209 | (?=([\])};,]|\b(else|then)\b)) 1210 | patterns 1211 | 1212 | 1213 | begin 1214 | \bif\b 1215 | beginCaptures 1216 | 1217 | 0 1218 | 1219 | name 1220 | keyword.other.nix 1221 | 1222 | 1223 | end 1224 | \bth(?=en\b) 1225 | endCaptures 1226 | 1227 | 0 1228 | 1229 | name 1230 | keyword.other.nix 1231 | 1232 | 1233 | patterns 1234 | 1235 | 1236 | include 1237 | #expression 1238 | 1239 | 1240 | 1241 | 1242 | begin 1243 | (?<=th)en\b 1244 | beginCaptures 1245 | 1246 | 0 1247 | 1248 | name 1249 | keyword.other.nix 1250 | 1251 | 1252 | end 1253 | \bel(?=se\b) 1254 | endCaptures 1255 | 1256 | 0 1257 | 1258 | name 1259 | keyword.other.nix 1260 | 1261 | 1262 | patterns 1263 | 1264 | 1265 | include 1266 | #expression 1267 | 1268 | 1269 | 1270 | 1271 | begin 1272 | (?<=el)se\b 1273 | beginCaptures 1274 | 1275 | 0 1276 | 1277 | name 1278 | keyword.other.nix 1279 | 1280 | 1281 | end 1282 | (?=([\])};,]|\b(else|then)\b)) 1283 | endCaptures 1284 | 1285 | 0 1286 | 1287 | name 1288 | keyword.other.nix 1289 | 1290 | 1291 | patterns 1292 | 1293 | 1294 | include 1295 | #expression 1296 | 1297 | 1298 | 1299 | 1300 | 1301 | illegal 1302 | 1303 | match 1304 | . 1305 | name 1306 | invalid.illegal 1307 | 1308 | interpolation 1309 | 1310 | begin 1311 | \$\{ 1312 | beginCaptures 1313 | 1314 | 0 1315 | 1316 | name 1317 | punctuation.section.embedded.begin.nix 1318 | 1319 | 1320 | end 1321 | \} 1322 | endCaptures 1323 | 1324 | 0 1325 | 1326 | name 1327 | punctuation.section.embedded.end.nix 1328 | 1329 | 1330 | name 1331 | markup.italic 1332 | patterns 1333 | 1334 | 1335 | include 1336 | #expression 1337 | 1338 | 1339 | 1340 | let 1341 | 1342 | begin 1343 | (?=\blet\b) 1344 | end 1345 | (?=([\])};,]|\b(else|then)\b)) 1346 | patterns 1347 | 1348 | 1349 | begin 1350 | \blet\b 1351 | beginCaptures 1352 | 1353 | 0 1354 | 1355 | name 1356 | keyword.other.nix 1357 | 1358 | 1359 | end 1360 | (?=([\])};,]|\b(in|else|then)\b)) 1361 | patterns 1362 | 1363 | 1364 | begin 1365 | (?=\{) 1366 | end 1367 | (?=([\])};,]|\b(else|then)\b)) 1368 | patterns 1369 | 1370 | 1371 | begin 1372 | \{ 1373 | end 1374 | \} 1375 | patterns 1376 | 1377 | 1378 | include 1379 | #attrset-contents 1380 | 1381 | 1382 | 1383 | 1384 | begin 1385 | (^|(?<=\})) 1386 | end 1387 | (?=([\])};,]|\b(else|then)\b)) 1388 | patterns 1389 | 1390 | 1391 | include 1392 | #expression-cont 1393 | 1394 | 1395 | 1396 | 1397 | include 1398 | #others 1399 | 1400 | 1401 | 1402 | 1403 | include 1404 | #attrset-contents 1405 | 1406 | 1407 | include 1408 | #others 1409 | 1410 | 1411 | 1412 | 1413 | begin 1414 | \bin\b 1415 | beginCaptures 1416 | 1417 | 0 1418 | 1419 | name 1420 | keyword.other.nix 1421 | 1422 | 1423 | end 1424 | (?=([\])};,]|\b(else|then)\b)) 1425 | patterns 1426 | 1427 | 1428 | include 1429 | #expression 1430 | 1431 | 1432 | 1433 | 1434 | 1435 | list 1436 | 1437 | begin 1438 | \[ 1439 | beginCaptures 1440 | 1441 | 0 1442 | 1443 | name 1444 | punctuation.definition.list.nix 1445 | 1446 | 1447 | end 1448 | \] 1449 | endCaptures 1450 | 1451 | 0 1452 | 1453 | name 1454 | punctuation.definition.list.nix 1455 | 1456 | 1457 | patterns 1458 | 1459 | 1460 | include 1461 | #expression 1462 | 1463 | 1464 | 1465 | list-and-cont 1466 | 1467 | begin 1468 | (?=\[) 1469 | end 1470 | (?=([\])};,]|\b(else|then)\b)) 1471 | patterns 1472 | 1473 | 1474 | include 1475 | #list 1476 | 1477 | 1478 | include 1479 | #expression-cont 1480 | 1481 | 1482 | 1483 | operator-unary 1484 | 1485 | match 1486 | (!|-) 1487 | name 1488 | keyword.operator.unary.nix 1489 | 1490 | others 1491 | 1492 | patterns 1493 | 1494 | 1495 | include 1496 | #whitespace 1497 | 1498 | 1499 | include 1500 | #comment 1501 | 1502 | 1503 | include 1504 | #illegal 1505 | 1506 | 1507 | 1508 | parameter-name 1509 | 1510 | captures 1511 | 1512 | 0 1513 | 1514 | name 1515 | variable.parameter.name.nix 1516 | 1517 | 1518 | match 1519 | \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 1520 | 1521 | parameter-name-and-cont 1522 | 1523 | begin 1524 | \b[a-zA-Z\_][a-zA-Z0-9\_\'\-]* 1525 | beginCaptures 1526 | 1527 | 0 1528 | 1529 | name 1530 | variable.parameter.name.nix 1531 | 1532 | 1533 | end 1534 | (?=([\])};,]|\b(else|then)\b)) 1535 | patterns 1536 | 1537 | 1538 | include 1539 | #expression-cont 1540 | 1541 | 1542 | 1543 | parens 1544 | 1545 | begin 1546 | \( 1547 | beginCaptures 1548 | 1549 | 0 1550 | 1551 | name 1552 | punctuation.definition.expression.nix 1553 | 1554 | 1555 | end 1556 | \) 1557 | endCaptures 1558 | 1559 | 0 1560 | 1561 | name 1562 | punctuation.definition.expression.nix 1563 | 1564 | 1565 | patterns 1566 | 1567 | 1568 | include 1569 | #expression 1570 | 1571 | 1572 | 1573 | parens-and-cont 1574 | 1575 | begin 1576 | (?=\() 1577 | end 1578 | (?=([\])};,]|\b(else|then)\b)) 1579 | patterns 1580 | 1581 | 1582 | include 1583 | #parens 1584 | 1585 | 1586 | include 1587 | #expression-cont 1588 | 1589 | 1590 | 1591 | string 1592 | 1593 | patterns 1594 | 1595 | 1596 | begin 1597 | (?=\'\') 1598 | end 1599 | (?=([\])};,]|\b(else|then)\b)) 1600 | patterns 1601 | 1602 | 1603 | begin 1604 | \'\' 1605 | beginCaptures 1606 | 1607 | 0 1608 | 1609 | name 1610 | punctuation.definition.string.other.start.nix 1611 | 1612 | 1613 | end 1614 | \'\'(?!\$|\'|\\.) 1615 | endCaptures 1616 | 1617 | 0 1618 | 1619 | name 1620 | punctuation.definition.string.other.end.nix 1621 | 1622 | 1623 | name 1624 | string.quoted.other.nix 1625 | patterns 1626 | 1627 | 1628 | match 1629 | \'\'(\$|\'|\\.) 1630 | name 1631 | constant.character.escape.nix 1632 | 1633 | 1634 | include 1635 | #interpolation 1636 | 1637 | 1638 | 1639 | 1640 | include 1641 | #expression-cont 1642 | 1643 | 1644 | 1645 | 1646 | begin 1647 | (?=\") 1648 | end 1649 | (?=([\])};,]|\b(else|then)\b)) 1650 | patterns 1651 | 1652 | 1653 | include 1654 | #string-quoted 1655 | 1656 | 1657 | include 1658 | #expression-cont 1659 | 1660 | 1661 | 1662 | 1663 | begin 1664 | (~?[a-zA-Z0-9\.\_\-\+]*(\/[a-zA-Z0-9\.\_\-\+]+)+) 1665 | beginCaptures 1666 | 1667 | 0 1668 | 1669 | name 1670 | string.unquoted.path.nix 1671 | 1672 | 1673 | end 1674 | (?=([\])};,]|\b(else|then)\b)) 1675 | patterns 1676 | 1677 | 1678 | include 1679 | #expression-cont 1680 | 1681 | 1682 | 1683 | 1684 | begin 1685 | (\<[a-zA-Z0-9\.\_\-\+]+(\/[a-zA-Z0-9\.\_\-\+]+)*\>) 1686 | beginCaptures 1687 | 1688 | 0 1689 | 1690 | name 1691 | string.unquoted.spath.nix 1692 | 1693 | 1694 | end 1695 | (?=([\])};,]|\b(else|then)\b)) 1696 | patterns 1697 | 1698 | 1699 | include 1700 | #expression-cont 1701 | 1702 | 1703 | 1704 | 1705 | begin 1706 | ([a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']+) 1707 | beginCaptures 1708 | 1709 | 0 1710 | 1711 | name 1712 | string.unquoted.url.nix 1713 | 1714 | 1715 | end 1716 | (?=([\])};,]|\b(else|then)\b)) 1717 | patterns 1718 | 1719 | 1720 | include 1721 | #expression-cont 1722 | 1723 | 1724 | 1725 | 1726 | 1727 | string-quoted 1728 | 1729 | begin 1730 | \" 1731 | beginCaptures 1732 | 1733 | 0 1734 | 1735 | name 1736 | punctuation.definition.string.double.start.nix 1737 | 1738 | 1739 | end 1740 | \" 1741 | endCaptures 1742 | 1743 | 0 1744 | 1745 | name 1746 | punctuation.definition.string.double.end.nix 1747 | 1748 | 1749 | name 1750 | string.quoted.double.nix 1751 | patterns 1752 | 1753 | 1754 | match 1755 | \\. 1756 | name 1757 | constant.character.escape.nix 1758 | 1759 | 1760 | include 1761 | #interpolation 1762 | 1763 | 1764 | 1765 | whitespace 1766 | 1767 | match 1768 | \s+ 1769 | 1770 | with-assert 1771 | 1772 | begin 1773 | (?<![\w'-])(with|assert)(?![\w'-]) 1774 | beginCaptures 1775 | 1776 | 0 1777 | 1778 | name 1779 | keyword.other.nix 1780 | 1781 | 1782 | end 1783 | \; 1784 | patterns 1785 | 1786 | 1787 | include 1788 | #expression 1789 | 1790 | 1791 | 1792 | 1793 | scopeName 1794 | source.nix 1795 | uuid 1796 | 0514fd5f-acb6-436d-b42c-7643e6d36c8f 1797 | 1798 | 1799 | --------------------------------------------------------------------------------