| 1 | { |
| 2 | "fileTypes": ["jade"], |
| 3 | "name": "Jade", |
| 4 | "patterns": [ |
| 5 | { |
| 6 | "comment": "Doctype declaration.", |
| 7 | "match": "^(!!!|doctype)(\\s*[a-zA-Z0-9-_]+)?", |
| 8 | "name": "meta.tag.sgml.doctype.html" |
| 9 | }, |
| 10 | { |
| 11 | "begin": "^(\\s*)//-", |
| 12 | "comment": "Unbuffered (jade-only) comments.", |
| 13 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 14 | "name": "comment.unbuffered.block.jade" |
| 15 | }, |
| 16 | { |
| 17 | "begin": "^(\\s*)//", |
| 18 | "comment": "Buffered (html) comments.", |
| 19 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 20 | "name": "string.comment.buffered.block.jade", |
| 21 | "patterns": [ |
| 22 | { |
| 23 | "captures": { |
| 24 | "1": { |
| 25 | "name": "invalid.illegal.comment.comment.block.jade" |
| 26 | } |
| 27 | }, |
| 28 | "comment": "Buffered comments inside buffered comments will generate invalid html.", |
| 29 | "match": "^\\s*(//)(?!-)", |
| 30 | "name": "string.comment.buffered.block.jade" |
| 31 | } |
| 32 | ] |
| 33 | }, |
| 34 | { |
| 35 | "begin": "^(\\s*)-$", |
| 36 | "comment": "Unbuffered code block.", |
| 37 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 38 | "name": "source.js", |
| 39 | "patterns": [ |
| 40 | { |
| 41 | "include": "source.js" |
| 42 | } |
| 43 | ] |
| 44 | }, |
| 45 | { |
| 46 | "begin": "^(\\s*)(script)(?=[.#(\\s])((?![^\\n]*type=)|(?=[^\\n]*(text|application)/javascript))", |
| 47 | "beginCaptures": { |
| 48 | "2": { |
| 49 | "name": "entity.name.tag.script.jade" |
| 50 | } |
| 51 | }, |
| 52 | "comment": "Script tag with JavaScript code.", |
| 53 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 54 | "name": "meta.tag.other", |
| 55 | "patterns": [ |
| 56 | { |
| 57 | "begin": "\\G(?=\\()", |
| 58 | "end": "$", |
| 59 | "name": "stuff.tag.script.jade", |
| 60 | "patterns": [ |
| 61 | { |
| 62 | "include": "#tag_attributes" |
| 63 | } |
| 64 | ] |
| 65 | }, |
| 66 | { |
| 67 | "begin": "\\G(?=[.#])", |
| 68 | "end": "$", |
| 69 | "name": "stuff.tag.script.jade", |
| 70 | "patterns": [ |
| 71 | { |
| 72 | "include": "#complete_tag" |
| 73 | } |
| 74 | ] |
| 75 | }, |
| 76 | { |
| 77 | "include": "source.js" |
| 78 | } |
| 79 | ] |
| 80 | }, |
| 81 | { |
| 82 | "begin": "^(\\s*)(style)((\\.$)|(?=[.#(].*\\.$))", |
| 83 | "beginCaptures": { |
| 84 | "2": { |
| 85 | "name": "entity.name.tag.script.jade" |
| 86 | } |
| 87 | }, |
| 88 | "comment": "Style tag with CSS code.", |
| 89 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 90 | "name": "meta.tag.other", |
| 91 | "patterns": [ |
| 92 | { |
| 93 | "begin": "\\G(?=\\()", |
| 94 | "end": "$", |
| 95 | "name": "stuff.tag.style.jade", |
| 96 | "patterns": [ |
| 97 | { |
| 98 | "include": "#tag_attributes" |
| 99 | } |
| 100 | ] |
| 101 | }, |
| 102 | { |
| 103 | "begin": "\\G(?=[.#])", |
| 104 | "end": "$", |
| 105 | "name": "stuff.tag.style.jade", |
| 106 | "patterns": [ |
| 107 | { |
| 108 | "include": "#complete_tag" |
| 109 | } |
| 110 | ] |
| 111 | }, |
| 112 | { |
| 113 | "include": "source.css" |
| 114 | } |
| 115 | ] |
| 116 | }, |
| 117 | { |
| 118 | "begin": "^(\\s*):(sass)(?=\\(|$)", |
| 119 | "beginCaptures": { |
| 120 | "2": { |
| 121 | "name": "constant.language.name.sass.filter.jade" |
| 122 | } |
| 123 | }, |
| 124 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 125 | "name": "source.sass.filter.jade", |
| 126 | "patterns": [ |
| 127 | { |
| 128 | "include": "#tag_attributes" |
| 129 | }, |
| 130 | { |
| 131 | "include": "source.sass" |
| 132 | } |
| 133 | ] |
| 134 | }, |
| 135 | { |
| 136 | "begin": "^(\\s*):(less)(?=\\(|$)", |
| 137 | "beginCaptures": { |
| 138 | "2": { |
| 139 | "name": "constant.language.name.less.filter.jade" |
| 140 | } |
| 141 | }, |
| 142 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 143 | "name": "source.less.filter.jade", |
| 144 | "patterns": [ |
| 145 | { |
| 146 | "include": "#tag_attributes" |
| 147 | }, |
| 148 | { |
| 149 | "include": "source.less" |
| 150 | } |
| 151 | ] |
| 152 | }, |
| 153 | { |
| 154 | "begin": "^(\\s*):(stylus)(?=\\(|$)", |
| 155 | "beginCaptures": { |
| 156 | "2": { |
| 157 | "name": "constant.language.name.stylus.filter.jade" |
| 158 | } |
| 159 | }, |
| 160 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 161 | "patterns": [ |
| 162 | { |
| 163 | "include": "#tag_attributes" |
| 164 | }, |
| 165 | { |
| 166 | "include": "source.stylus" |
| 167 | } |
| 168 | ] |
| 169 | }, |
| 170 | { |
| 171 | "begin": "^(\\s*):(coffee(-?script)?)(?=\\(|$)", |
| 172 | "beginCaptures": { |
| 173 | "2": { |
| 174 | "name": "constant.language.name.coffeescript.filter.jade" |
| 175 | } |
| 176 | }, |
| 177 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 178 | "name": "source.coffeescript.filter.jade", |
| 179 | "patterns": [ |
| 180 | { |
| 181 | "include": "#tag_attributes" |
| 182 | }, |
| 183 | { |
| 184 | "include": "source.coffee" |
| 185 | } |
| 186 | ] |
| 187 | }, |
| 188 | { |
| 189 | "begin": "^(\\s*)((:(?=.))|(:$))", |
| 190 | "beginCaptures": { |
| 191 | "4": { |
| 192 | "name": "invalid.illegal.empty.generic.filter.jade" |
| 193 | } |
| 194 | }, |
| 195 | "comment": "Generic Jade filter.", |
| 196 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 197 | "patterns": [ |
| 198 | { |
| 199 | "begin": "\\G(?<=:)(?=.)", |
| 200 | "end": "$", |
| 201 | "name": "name.generic.filter.jade", |
| 202 | "patterns": [ |
| 203 | { |
| 204 | "match": "\\G\\(", |
| 205 | "name": "invalid.illegal.name.generic.filter.jade" |
| 206 | }, |
| 207 | { |
| 208 | "match": "[\\w-]", |
| 209 | "name": "constant.language.name.generic.filter.jade" |
| 210 | }, |
| 211 | { |
| 212 | "include": "#tag_attributes" |
| 213 | }, |
| 214 | { |
| 215 | "match": "\\W", |
| 216 | "name": "invalid.illegal.name.generic.filter.jade" |
| 217 | } |
| 218 | ] |
| 219 | } |
| 220 | ] |
| 221 | }, |
| 222 | { |
| 223 | "begin": "^(\\s*)(?=[\\w.#].*?\\.$)(?=(?:(?:(?:(?:(?:#[\\w-]+)|(?:\\.[\\w-]+))|(?:(?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))(?:(?:#[\\w-]+)|(?:\\.[\\w-]+)|(?:\\((?:[^()\\'\\\"]*(?:(?:\\'(?:[^\\']|(?:(?<!\\\\)\\\\\\'))*\\')|(?:\\\"(?:[^\\\"]|(?:(?<!\\\\)\\\\\\\"))*\\\")))*[^()]*\\))*)*)(?:(?:(?::\\s+)|(?<=\\)))(?:(?:(?:(?:#[\\w-]+)|(?:\\.[\\w-]+))|(?:(?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))(?:(?:#[\\w-]+)|(?:\\.[\\w-]+)|(?:\\((?:[^()\\'\\\"]*(?:(?:\\'(?:[^\\']|(?:(?<!\\\\)\\\\\\'))*\\')|(?:\\\"(?:[^\\\"]|(?:(?<!\\\\)\\\\\\\"))*\\\")))*[^()]*\\))*)*))*)\\.$)(?:(?:(#[\\w-]+)|(\\.[\\w-]+))|((?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))", |
| 224 | "beginCaptures": { |
| 225 | "2": { |
| 226 | "name": "constant.id.tag.jade" |
| 227 | }, |
| 228 | "3": { |
| 229 | "name": "constant.language.js" |
| 230 | }, |
| 231 | "4": { |
| 232 | "name": "meta.tag.other entity.name.tag.jade" |
| 233 | } |
| 234 | }, |
| 235 | "comment": "Generated from dot_block_tag.py", |
| 236 | "end": "^(?!(\\1\\s)|\\s*$)", |
| 237 | "patterns": [ |
| 238 | { |
| 239 | "include": "#tag_attributes" |
| 240 | }, |
| 241 | { |
| 242 | "include": "#complete_tag" |
| 243 | }, |
| 244 | { |
| 245 | "begin": "^(?=.)", |
| 246 | "end": "$", |
| 247 | "name": "text.block.jade", |
| 248 | "patterns": [ |
| 249 | { |
| 250 | "include": "#inline_jade" |
| 251 | }, |
| 252 | { |
| 253 | "include": "#embedded_html" |
| 254 | }, |
| 255 | { |
| 256 | "include": "#html_entity" |
| 257 | }, |
| 258 | { |
| 259 | "include": "#interpolated_value" |
| 260 | }, |
| 261 | { |
| 262 | "include": "#interpolated_error" |
| 263 | } |
| 264 | ] |
| 265 | } |
| 266 | ] |
| 267 | }, |
| 268 | { |
| 269 | "begin": "^\\s*", |
| 270 | "comment": "All constructs that generally span a single line starting with any number of white-spaces.", |
| 271 | "end": "$", |
| 272 | "patterns": [ |
| 273 | { |
| 274 | "include": "#inline_jade" |
| 275 | }, |
| 276 | { |
| 277 | "include": "#blocks_and_includes" |
| 278 | }, |
| 279 | { |
| 280 | "include": "#unbuffered_code" |
| 281 | }, |
| 282 | { |
| 283 | "include": "#mixin_definition" |
| 284 | }, |
| 285 | { |
| 286 | "include": "#mixin_call" |
| 287 | }, |
| 288 | { |
| 289 | "include": "#flow_control" |
| 290 | }, |
| 291 | { |
| 292 | "include": "#case_conds" |
| 293 | }, |
| 294 | { |
| 295 | "begin": "\\|", |
| 296 | "comment": "Tag pipe text line.", |
| 297 | "end": "$", |
| 298 | "name": "text.block.pipe.jade", |
| 299 | "patterns": [ |
| 300 | { |
| 301 | "include": "#inline_jade" |
| 302 | }, |
| 303 | { |
| 304 | "include": "#embedded_html" |
| 305 | }, |
| 306 | { |
| 307 | "include": "#html_entity" |
| 308 | }, |
| 309 | { |
| 310 | "include": "#interpolated_value" |
| 311 | }, |
| 312 | { |
| 313 | "include": "#interpolated_error" |
| 314 | } |
| 315 | ] |
| 316 | }, |
| 317 | { |
| 318 | "include": "#printed_expression" |
| 319 | }, |
| 320 | { |
| 321 | "begin": "\\G(?=(#[^\\{\\w-])|[^\\w.#])", |
| 322 | "comment": "Line starting with characters incompatible with tag name/id/class is standalone text.", |
| 323 | "end": "$", |
| 324 | "patterns": [ |
| 325 | { |
| 326 | "begin": "</?(?=[!#])", |
| 327 | "end": ">|$", |
| 328 | "patterns": [ |
| 329 | { |
| 330 | "include": "#inline_jade" |
| 331 | }, |
| 332 | { |
| 333 | "include": "#interpolated_value" |
| 334 | }, |
| 335 | { |
| 336 | "include": "#interpolated_error" |
| 337 | } |
| 338 | ] |
| 339 | }, |
| 340 | { |
| 341 | "include": "#inline_jade" |
| 342 | }, |
| 343 | { |
| 344 | "include": "#embedded_html" |
| 345 | }, |
| 346 | { |
| 347 | "include": "#html_entity" |
| 348 | }, |
| 349 | { |
| 350 | "include": "#interpolated_value" |
| 351 | }, |
| 352 | { |
| 353 | "include": "#interpolated_error" |
| 354 | } |
| 355 | ] |
| 356 | }, |
| 357 | { |
| 358 | "include": "#complete_tag" |
| 359 | } |
| 360 | ] |
| 361 | } |
| 362 | ], |
| 363 | "repository": { |
| 364 | "blocks_and_includes": { |
| 365 | "captures": { |
| 366 | "1": { |
| 367 | "name": "storage.type.import.include.jade" |
| 368 | }, |
| 369 | "4": { |
| 370 | "name": "variable.control.import.include.jade" |
| 371 | } |
| 372 | }, |
| 373 | "comment": "Template blocks and includes.", |
| 374 | "match": "(extends|include|yield|append|prepend|block( (append|prepend))?)\\s+(.*)$", |
| 375 | "name": "meta.first-class.jade" |
| 376 | }, |
| 377 | "case_conds": { |
| 378 | "begin": "(default|when)((\\s+|(?=:))|$)", |
| 379 | "captures": { |
| 380 | "1": { |
| 381 | "name": "storage.type.function.jade" |
| 382 | } |
| 383 | }, |
| 384 | "comment": "Jade case conditionals.", |
| 385 | "end": "$", |
| 386 | "name": "meta.control.flow.jade", |
| 387 | "patterns": [ |
| 388 | { |
| 389 | "begin": "\\G(?!:)", |
| 390 | "end": "(?=:\\s+)|$", |
| 391 | "name": "js.embedded.control.flow.jade", |
| 392 | "patterns": [ |
| 393 | { |
| 394 | "include": "#case_when_paren" |
| 395 | }, |
| 396 | { |
| 397 | "include": "source.js" |
| 398 | } |
| 399 | ] |
| 400 | }, |
| 401 | { |
| 402 | "begin": ":\\s+", |
| 403 | "end": "$", |
| 404 | "name": "tag.case.control.flow.jade", |
| 405 | "patterns": [ |
| 406 | { |
| 407 | "include": "#complete_tag" |
| 408 | } |
| 409 | ] |
| 410 | } |
| 411 | ] |
| 412 | }, |
| 413 | "case_when_paren": { |
| 414 | "begin": "\\(", |
| 415 | "end": "\\)", |
| 416 | "name": "js.when.control.flow.jade", |
| 417 | "patterns": [ |
| 418 | { |
| 419 | "include": "#case_when_paren" |
| 420 | }, |
| 421 | { |
| 422 | "match": ":", |
| 423 | "name": "invalid.illegal.name.tag.jade" |
| 424 | }, |
| 425 | { |
| 426 | "include": "source.js" |
| 427 | } |
| 428 | ] |
| 429 | }, |
| 430 | "complete_tag": { |
| 431 | "begin": "(?=[\\w.#])|(:\\s*)", |
| 432 | "end": "(\\.?$)|(?=:.)", |
| 433 | "patterns": [ |
| 434 | { |
| 435 | "include": "#blocks_and_includes" |
| 436 | }, |
| 437 | { |
| 438 | "include": "#unbuffered_code" |
| 439 | }, |
| 440 | { |
| 441 | "include": "#mixin_call" |
| 442 | }, |
| 443 | { |
| 444 | "include": "#flow_control" |
| 445 | }, |
| 446 | { |
| 447 | "match": "(?<=:)\\w.*$", |
| 448 | "name": "invalid.illegal.name.tag.jade" |
| 449 | }, |
| 450 | { |
| 451 | "include": "#tag_name" |
| 452 | }, |
| 453 | { |
| 454 | "include": "#tag_id" |
| 455 | }, |
| 456 | { |
| 457 | "include": "#tag_classes" |
| 458 | }, |
| 459 | { |
| 460 | "include": "#tag_attributes" |
| 461 | }, |
| 462 | { |
| 463 | "include": "#tag_mixin_attributes" |
| 464 | }, |
| 465 | { |
| 466 | "captures": { |
| 467 | "2": { |
| 468 | "name": "invalid.illegal.end.tag.jade" |
| 469 | }, |
| 470 | "4": { |
| 471 | "name": "invalid.illegal.end.tag.jade" |
| 472 | } |
| 473 | }, |
| 474 | "match": "((\\.)\\s+$)|((:)\\s*$)" |
| 475 | }, |
| 476 | { |
| 477 | "include": "#printed_expression" |
| 478 | }, |
| 479 | { |
| 480 | "include": "#tag_text" |
| 481 | } |
| 482 | ] |
| 483 | }, |
| 484 | "embedded_html": { |
| 485 | "begin": "(?=<[^>]*>)", |
| 486 | "end": "$|(?=>)", |
| 487 | "name": "html", |
| 488 | "patterns": [ |
| 489 | { |
| 490 | "include": "text.html.basic" |
| 491 | }, |
| 492 | { |
| 493 | "include": "#interpolated_value" |
| 494 | }, |
| 495 | { |
| 496 | "include": "#interpolated_error" |
| 497 | } |
| 498 | ] |
| 499 | }, |
| 500 | "flow_control": { |
| 501 | "begin": "(for|if|else if|else|each|until|while|unless|case)(\\s+|$)", |
| 502 | "captures": { |
| 503 | "1": { |
| 504 | "name": "storage.type.function.jade" |
| 505 | } |
| 506 | }, |
| 507 | "comment": "Jade control flow.", |
| 508 | "end": "$", |
| 509 | "name": "meta.control.flow.jade", |
| 510 | "patterns": [ |
| 511 | { |
| 512 | "begin": "", |
| 513 | "end": "$", |
| 514 | "name": "js.embedded.control.flow.jade", |
| 515 | "patterns": [ |
| 516 | { |
| 517 | "include": "source.js" |
| 518 | } |
| 519 | ] |
| 520 | } |
| 521 | ] |
| 522 | }, |
| 523 | "html_entity": { |
| 524 | "patterns": [ |
| 525 | { |
| 526 | "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", |
| 527 | "name": "constant.character.entity.html.text.jade" |
| 528 | }, |
| 529 | { |
| 530 | "match": "[<>&]", |
| 531 | "name": "invalid.illegal.html_entity.text.jade" |
| 532 | } |
| 533 | ] |
| 534 | }, |
| 535 | "inline_jade": { |
| 536 | "begin": "(?<!\\\\)(#\\[)", |
| 537 | "captures": { |
| 538 | "1": { |
| 539 | "name": "entity.name.function.jade" |
| 540 | }, |
| 541 | "2": { |
| 542 | "name": "entity.name.function.jade" |
| 543 | } |
| 544 | }, |
| 545 | "end": "(\\])", |
| 546 | "name": "inline.jade", |
| 547 | "patterns": [ |
| 548 | { |
| 549 | "include": "#inline_jade" |
| 550 | }, |
| 551 | { |
| 552 | "include": "#mixin_call" |
| 553 | }, |
| 554 | { |
| 555 | "begin": "(?<!\\])(?=[\\w.#])|(:\\s*)", |
| 556 | "end": "(?=\\]|(:.)|=|\\s)", |
| 557 | "name": "tag.inline.jade", |
| 558 | "patterns": [ |
| 559 | { |
| 560 | "include": "#tag_name" |
| 561 | }, |
| 562 | { |
| 563 | "include": "#tag_id" |
| 564 | }, |
| 565 | { |
| 566 | "include": "#tag_classes" |
| 567 | }, |
| 568 | { |
| 569 | "include": "#tag_attributes" |
| 570 | }, |
| 571 | { |
| 572 | "include": "#tag_mixin_attributes" |
| 573 | }, |
| 574 | { |
| 575 | "include": "#inline_jade" |
| 576 | }, |
| 577 | { |
| 578 | "match": "\\[", |
| 579 | "name": "invalid.illegal.tag.jade" |
| 580 | } |
| 581 | ] |
| 582 | }, |
| 583 | { |
| 584 | "include": "#unbuffered_code" |
| 585 | }, |
| 586 | { |
| 587 | "include": "#printed_expression" |
| 588 | }, |
| 589 | { |
| 590 | "match": "\\[", |
| 591 | "name": "invalid.illegal.tag.jade" |
| 592 | }, |
| 593 | { |
| 594 | "include": "#inline_jade_text" |
| 595 | } |
| 596 | ] |
| 597 | }, |
| 598 | "inline_jade_text": { |
| 599 | "begin": "", |
| 600 | "end": "(?=\\])", |
| 601 | "patterns": [ |
| 602 | { |
| 603 | "begin": "\\[", |
| 604 | "end": "\\]", |
| 605 | "patterns": [ |
| 606 | { |
| 607 | "include": "#inline_jade_text" |
| 608 | } |
| 609 | ] |
| 610 | }, |
| 611 | { |
| 612 | "include": "#inline_jade" |
| 613 | }, |
| 614 | { |
| 615 | "include": "#embedded_html" |
| 616 | }, |
| 617 | { |
| 618 | "include": "#html_entity" |
| 619 | }, |
| 620 | { |
| 621 | "include": "#interpolated_value" |
| 622 | }, |
| 623 | { |
| 624 | "include": "#interpolated_error" |
| 625 | } |
| 626 | ] |
| 627 | }, |
| 628 | "interpolated_error": { |
| 629 | "match": "(?<!\\\\)[#!]\\{(?=[^}]*$)", |
| 630 | "name": "invalid.illegal.tag.jade" |
| 631 | }, |
| 632 | "interpolated_value": { |
| 633 | "begin": "(?<!\\\\)[#!]\\{(?=.*?\\})", |
| 634 | "end": "\\}", |
| 635 | "name": "string.interpolated.jade", |
| 636 | "patterns": [ |
| 637 | { |
| 638 | "match": "{", |
| 639 | "name": "invalid.illegal.tag.jade" |
| 640 | }, |
| 641 | { |
| 642 | "include": "source.js" |
| 643 | } |
| 644 | ] |
| 645 | }, |
| 646 | "js_braces": { |
| 647 | "begin": "\\{", |
| 648 | "end": "\\}", |
| 649 | "patterns": [ |
| 650 | { |
| 651 | "include": "#js_braces" |
| 652 | }, |
| 653 | { |
| 654 | "include": "source.js" |
| 655 | } |
| 656 | ] |
| 657 | }, |
| 658 | "js_brackets": { |
| 659 | "begin": "\\[", |
| 660 | "end": "\\]", |
| 661 | "patterns": [ |
| 662 | { |
| 663 | "include": "#js_brackets" |
| 664 | }, |
| 665 | { |
| 666 | "include": "source.js" |
| 667 | } |
| 668 | ] |
| 669 | }, |
| 670 | "js_parens": { |
| 671 | "begin": "\\(", |
| 672 | "end": "\\)", |
| 673 | "patterns": [ |
| 674 | { |
| 675 | "include": "#js_parens" |
| 676 | }, |
| 677 | { |
| 678 | "include": "source.js" |
| 679 | } |
| 680 | ] |
| 681 | }, |
| 682 | "mixin_call": { |
| 683 | "begin": "((?:mixin\\s+)|\\+)([\\w-]+)", |
| 684 | "beginCaptures": { |
| 685 | "1": { |
| 686 | "name": "storage.type.function.jade" |
| 687 | }, |
| 688 | "2": { |
| 689 | "name": "meta.tag.other entity.name.function.jade" |
| 690 | } |
| 691 | }, |
| 692 | "end": "(?!\\()|$", |
| 693 | "patterns": [ |
| 694 | { |
| 695 | "begin": "(?<!\\))\\(", |
| 696 | "end": "\\)", |
| 697 | "name": "args.mixin.jade", |
| 698 | "patterns": [ |
| 699 | { |
| 700 | "include": "#js_parens" |
| 701 | }, |
| 702 | { |
| 703 | "include": "#string" |
| 704 | }, |
| 705 | { |
| 706 | "captures": { |
| 707 | "1": { |
| 708 | "name": "meta.tag.other entity.other.attribute-name.tag.jade" |
| 709 | } |
| 710 | }, |
| 711 | "match": "([^\\s(),=/]+)\\s*=\\s*" |
| 712 | }, |
| 713 | { |
| 714 | "include": "source.js" |
| 715 | } |
| 716 | ] |
| 717 | }, |
| 718 | { |
| 719 | "include": "#tag_attributes" |
| 720 | } |
| 721 | ] |
| 722 | }, |
| 723 | "mixin_definition": { |
| 724 | "captures": { |
| 725 | "1": { |
| 726 | "name": "storage.type.function.jade" |
| 727 | }, |
| 728 | "2": { |
| 729 | "name": "meta.tag.other entity.name.function.jade" |
| 730 | }, |
| 731 | "3": { |
| 732 | "name": "punctuation.definition.parameters.begin.js" |
| 733 | }, |
| 734 | "4": { |
| 735 | "name": "variable.parameter.function.js" |
| 736 | }, |
| 737 | "5": { |
| 738 | "name": "punctuation.definition.parameters.begin.js" |
| 739 | } |
| 740 | }, |
| 741 | "match": "(mixin\\s+)([\\w-]+)(?:(\\()\\s*((?:[a-zA-Z_]\\w*\\s*)(?:,\\s*[a-zA-Z_]\\w*\\s*)*)(\\)))?$" |
| 742 | }, |
| 743 | "printed_expression": { |
| 744 | "begin": "(!?\\=)\\s*", |
| 745 | "captures": { |
| 746 | "1": { |
| 747 | "name": "constant" |
| 748 | } |
| 749 | }, |
| 750 | "end": "(?=\\])|$", |
| 751 | "name": "source.js", |
| 752 | "patterns": [ |
| 753 | { |
| 754 | "include": "#js_brackets" |
| 755 | }, |
| 756 | { |
| 757 | "include": "source.js" |
| 758 | } |
| 759 | ] |
| 760 | }, |
| 761 | "string": { |
| 762 | "begin": "(['\"])", |
| 763 | "end": "(?<!\\\\)\\1", |
| 764 | "name": "string.quoted.jade", |
| 765 | "patterns": [ |
| 766 | { |
| 767 | "match": "\\\\((x[0-9a-fA-F]{2})|(u[0-9]{4})|.)", |
| 768 | "name": "constant.character.quoted.jade" |
| 769 | }, |
| 770 | { |
| 771 | "include": "#interpolated_value" |
| 772 | }, |
| 773 | { |
| 774 | "include": "#interpolated_error" |
| 775 | } |
| 776 | ] |
| 777 | }, |
| 778 | "tag_attribute_name": { |
| 779 | "captures": { |
| 780 | "1": { |
| 781 | "name": "entity.other.attribute-name.tag.jade" |
| 782 | } |
| 783 | }, |
| 784 | "match": "([^\\s(),=/!]+)\\s*" |
| 785 | }, |
| 786 | "tag_attribute_name_paren": { |
| 787 | "begin": "\\(\\s*", |
| 788 | "end": "\\)", |
| 789 | "name": "entity.other.attribute-name.tag.jade", |
| 790 | "patterns": [ |
| 791 | { |
| 792 | "include": "#tag_attribute_name_paren" |
| 793 | }, |
| 794 | { |
| 795 | "include": "#tag_attribute_name" |
| 796 | } |
| 797 | ] |
| 798 | }, |
| 799 | "tag_attributes": { |
| 800 | "begin": "(\\(\\s*)", |
| 801 | "captures": { |
| 802 | "1": { |
| 803 | "name": "constant.name.attribute.tag.jade" |
| 804 | } |
| 805 | }, |
| 806 | "end": "(\\))", |
| 807 | "name": "meta.tag.other", |
| 808 | "patterns": [ |
| 809 | { |
| 810 | "include": "#tag_attribute_name_paren" |
| 811 | }, |
| 812 | { |
| 813 | "include": "#tag_attribute_name" |
| 814 | }, |
| 815 | { |
| 816 | "match": "!(?!=)", |
| 817 | "name": "invalid.illegal.tag.jade" |
| 818 | }, |
| 819 | { |
| 820 | "begin": "=\\s*", |
| 821 | "end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))", |
| 822 | "name": "attribute_value", |
| 823 | "patterns": [ |
| 824 | { |
| 825 | "include": "#string" |
| 826 | }, |
| 827 | { |
| 828 | "include": "#js_parens" |
| 829 | }, |
| 830 | { |
| 831 | "include": "#js_brackets" |
| 832 | }, |
| 833 | { |
| 834 | "include": "#js_braces" |
| 835 | }, |
| 836 | { |
| 837 | "include": "source.js" |
| 838 | } |
| 839 | ] |
| 840 | }, |
| 841 | { |
| 842 | "begin": "(?<=[%&*-+~|<>:?/])\\s+", |
| 843 | "end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))", |
| 844 | "name": "attribute_value2", |
| 845 | "patterns": [ |
| 846 | { |
| 847 | "include": "#string" |
| 848 | }, |
| 849 | { |
| 850 | "include": "#js_parens" |
| 851 | }, |
| 852 | { |
| 853 | "include": "#js_brackets" |
| 854 | }, |
| 855 | { |
| 856 | "include": "#js_braces" |
| 857 | }, |
| 858 | { |
| 859 | "include": "source.js" |
| 860 | } |
| 861 | ] |
| 862 | } |
| 863 | ] |
| 864 | }, |
| 865 | "tag_classes": { |
| 866 | "captures": { |
| 867 | "1": { |
| 868 | "name": "invalid.illegal.tag.jade" |
| 869 | } |
| 870 | }, |
| 871 | "match": "\\.([^\\w-])?[\\w-]*", |
| 872 | "name": "constant.language.js" |
| 873 | }, |
| 874 | "tag_id": { |
| 875 | "match": "#[\\w-]+", |
| 876 | "name": "constant.id.tag.jade" |
| 877 | }, |
| 878 | "tag_mixin_attributes": { |
| 879 | "begin": "(&attributes\\()", |
| 880 | "captures": { |
| 881 | "1": { |
| 882 | "name": "entity.name.function.jade" |
| 883 | } |
| 884 | }, |
| 885 | "end": "(\\))", |
| 886 | "name": "meta.tag.other", |
| 887 | "patterns": [ |
| 888 | { |
| 889 | "match": "attributes(?=\\))", |
| 890 | "name": "storage.type.keyword.jade" |
| 891 | }, |
| 892 | { |
| 893 | "include": "source.js" |
| 894 | } |
| 895 | ] |
| 896 | }, |
| 897 | "tag_name": { |
| 898 | "begin": "([#!]\\{(?=.*?\\}))|(\\w(([\\w:-]+[\\w-])|([\\w-]*)))", |
| 899 | "end": "(\\G(?<!\\5[^\\w-]))|\\}|$", |
| 900 | "name": "meta.tag.other entity.name.tag.jade", |
| 901 | "patterns": [ |
| 902 | { |
| 903 | "begin": "\\G(?<=\\{)", |
| 904 | "end": "(?=\\})", |
| 905 | "name": "meta.tag.other entity.name.tag.jade", |
| 906 | "patterns": [ |
| 907 | { |
| 908 | "match": "{", |
| 909 | "name": "invalid.illegal.tag.jade" |
| 910 | }, |
| 911 | { |
| 912 | "include": "source.js" |
| 913 | } |
| 914 | ] |
| 915 | } |
| 916 | ] |
| 917 | }, |
| 918 | "tag_text": { |
| 919 | "begin": "(?=.)", |
| 920 | "end": "$", |
| 921 | "patterns": [ |
| 922 | { |
| 923 | "include": "#inline_jade" |
| 924 | }, |
| 925 | { |
| 926 | "include": "#embedded_html" |
| 927 | }, |
| 928 | { |
| 929 | "include": "#html_entity" |
| 930 | }, |
| 931 | { |
| 932 | "include": "#interpolated_value" |
| 933 | }, |
| 934 | { |
| 935 | "include": "#interpolated_error" |
| 936 | } |
| 937 | ] |
| 938 | }, |
| 939 | "unbuffered_code": { |
| 940 | "begin": "(-|(([a-zA-Z0-9_]+)\\s+=))", |
| 941 | "beginCaptures": { |
| 942 | "3": { |
| 943 | "name": "variable.parameter.javascript.embedded.jade" |
| 944 | } |
| 945 | }, |
| 946 | "comment": "name = function() {}", |
| 947 | "end": "(?=\\])|$", |
| 948 | "name": "source.js", |
| 949 | "patterns": [ |
| 950 | { |
| 951 | "include": "#js_brackets" |
| 952 | }, |
| 953 | { |
| 954 | "include": "source.js" |
| 955 | } |
| 956 | ] |
| 957 | } |
| 958 | }, |
| 959 | "scopeName": "text.jade", |
| 960 | "uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b", |
| 961 | "version": "https://github.com/davidrios/jade-tmbundle/commit/7c1304aa5a0d916a93fd296d3dd994219ecdc90f" |
| 962 | } |