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