|
466 | 466 | 'heredoc':
|
467 | 467 | 'patterns': [
|
468 | 468 | {
|
469 |
| - 'begin': '<<<\\s*("?)([a-zA-Z_]+[a-zA-Z0-9_]*)\\1\\s*$', |
470 |
| - 'end': '^\\2' |
471 |
| - # 'injections': |
472 |
| - # '*': |
473 |
| - # 'patterns': [ |
474 |
| - # { |
475 |
| - # 'include': '#interpolation' |
476 |
| - # } |
477 |
| - # ] |
| 469 | + 'begin': '(?=<<<\\s*("?)([a-zA-Z_]+[a-zA-Z0-9_]*)\\1$)' |
| 470 | + 'end': '(?<=^\\2)\\b' |
| 471 | + 'injections': |
| 472 | + '*': |
| 473 | + 'patterns': [ |
| 474 | + { |
| 475 | + 'include': '#interpolation' |
| 476 | + } |
| 477 | + ] |
478 | 478 | 'name': 'string.unquoted.heredoc.php'
|
479 | 479 | 'patterns': [
|
480 | 480 | {
|
481 |
| - 'include': '#interpolation' |
| 481 | + 'include': '#heredoc_interior' |
482 | 482 | }
|
483 | 483 | ]
|
484 | 484 | }
|
485 | 485 | {
|
486 |
| - 'begin': '<<<\\s*\'([a-zA-Z_]+[a-zA-Z0-9_]*)\'\\s*$', |
487 |
| - 'end': '^\\1' |
| 486 | + 'begin': '(?=<<<\\s*\'([a-zA-Z_]+[a-zA-Z0-9_]*)\'$)' |
| 487 | + 'end': '(?<=^\\1)\\b' |
488 | 488 | 'name': 'string.unquoted.heredoc.nowdoc.php'
|
| 489 | + 'patterns': [ |
| 490 | + { |
| 491 | + 'include': '#heredoc_interior' |
| 492 | + } |
| 493 | + ] |
489 | 494 | }
|
490 | 495 | ]
|
491 |
| - # 'repository': |
492 |
| - # 'heredoc_interior': |
493 |
| - # 'patterns': [ |
494 |
| - # { |
495 |
| - # 'begin': '(<<<)\\s*([\'"]?)(HTML)(\\2)\\s*$\\n?' |
496 |
| - # 'beginCaptures': |
497 |
| - # '0': |
498 |
| - # 'name': 'punctuation.section.embedded.begin.php' |
499 |
| - # '1': |
500 |
| - # 'name': 'punctuation.definition.string.php' |
501 |
| - # '3': |
502 |
| - # 'name': 'keyword.operator.heredoc.php' |
503 |
| - # 'contentName': 'text.html' |
504 |
| - # 'end': '^(\\3)\\b' |
505 |
| - # 'endCaptures': |
506 |
| - # '0': |
507 |
| - # 'name': 'punctuation.section.embedded.end.php' |
508 |
| - # '1': |
509 |
| - # 'name': 'keyword.operator.heredoc.php' |
510 |
| - # 'name': 'meta.embedded.html' |
511 |
| - # 'patterns': [ |
512 |
| - # { |
513 |
| - # 'include': 'text.html.basic' |
514 |
| - # } |
515 |
| - # ] |
516 |
| - # } |
517 |
| - # { |
518 |
| - # 'begin': '(<<<)\\s*([\'"]?)(XML)(\\2)\\s*$\\n?' |
519 |
| - # 'beginCaptures': |
520 |
| - # '0': |
521 |
| - # 'name': 'punctuation.section.embedded.begin.php' |
522 |
| - # '1': |
523 |
| - # 'name': 'punctuation.definition.string.php' |
524 |
| - # '3': |
525 |
| - # 'name': 'keyword.operator.heredoc.php' |
526 |
| - # 'contentName': 'text.xml' |
527 |
| - # 'end': '^(\\3)\\b' |
528 |
| - # 'endCaptures': |
529 |
| - # '0': |
530 |
| - # 'name': 'punctuation.section.embedded.end.php' |
531 |
| - # '1': |
532 |
| - # 'name': 'keyword.operator.heredoc.php' |
533 |
| - # 'name': 'meta.embedded.xml' |
534 |
| - # 'patterns': [ |
535 |
| - # { |
536 |
| - # 'include': 'text.xml' |
537 |
| - # } |
538 |
| - # ] |
539 |
| - # } |
540 |
| - # { |
541 |
| - # 'begin': '(<<<)\\s*([\'"]?)(SQL)(\\2)\\s*$\\n?' |
542 |
| - # 'beginCaptures': |
543 |
| - # '0': |
544 |
| - # 'name': 'punctuation.section.embedded.begin.php' |
545 |
| - # '1': |
546 |
| - # 'name': 'punctuation.definition.string.php' |
547 |
| - # '3': |
548 |
| - # 'name': 'keyword.operator.heredoc.php' |
549 |
| - # 'contentName': 'source.sql' |
550 |
| - # 'end': '^(\\3)\\b' |
551 |
| - # 'endCaptures': |
552 |
| - # '0': |
553 |
| - # 'name': 'punctuation.section.embedded.end.php' |
554 |
| - # '1': |
555 |
| - # 'name': 'keyword.operator.heredoc.php' |
556 |
| - # 'name': 'meta.embedded.sql' |
557 |
| - # 'patterns': [ |
558 |
| - # { |
559 |
| - # 'include': 'source.sql' |
560 |
| - # } |
561 |
| - # ] |
562 |
| - # } |
563 |
| - # { |
564 |
| - # 'begin': '(<<<)\\s*([\'"]?)(JAVASCRIPT)(\\2)\\s*$\\n?' |
565 |
| - # 'beginCaptures': |
566 |
| - # '0': |
567 |
| - # 'name': 'punctuation.section.embedded.begin.php' |
568 |
| - # '1': |
569 |
| - # 'name': 'punctuation.definition.string.php' |
570 |
| - # '3': |
571 |
| - # 'name': 'keyword.operator.heredoc.php' |
572 |
| - # 'contentName': 'source.js' |
573 |
| - # 'end': '^(\\3)\\b' |
574 |
| - # 'endCaptures': |
575 |
| - # '0': |
576 |
| - # 'name': 'punctuation.section.embedded.end.php' |
577 |
| - # '1': |
578 |
| - # 'name': 'keyword.operator.heredoc.php' |
579 |
| - # 'name': 'meta.embedded.js' |
580 |
| - # 'patterns': [ |
581 |
| - # { |
582 |
| - # 'include': 'source.js' |
583 |
| - # } |
584 |
| - # ] |
585 |
| - # } |
586 |
| - # { |
587 |
| - # 'begin': '(<<<)\\s*([\'"]?)(JSON)(\\2)\\s*$\\n?' |
588 |
| - # 'beginCaptures': |
589 |
| - # '0': |
590 |
| - # 'name': 'punctuation.section.embedded.begin.php' |
591 |
| - # '1': |
592 |
| - # 'name': 'punctuation.definition.string.php' |
593 |
| - # '3': |
594 |
| - # 'name': 'keyword.operator.heredoc.php' |
595 |
| - # 'contentName': 'source.json' |
596 |
| - # 'end': '^(\\3)\\b' |
597 |
| - # 'endCaptures': |
598 |
| - # '0': |
599 |
| - # 'name': 'punctuation.section.embedded.end.php' |
600 |
| - # '1': |
601 |
| - # 'name': 'keyword.operator.heredoc.php' |
602 |
| - # 'name': 'meta.embedded.json' |
603 |
| - # 'patterns': [ |
604 |
| - # { |
605 |
| - # 'include': 'source.json' |
606 |
| - # } |
607 |
| - # ] |
608 |
| - # } |
609 |
| - # { |
610 |
| - # 'begin': '(<<<)\\s*([\'"]?)(CSS)(\\2)\\s*$\\n?' |
611 |
| - # 'beginCaptures': |
612 |
| - # '0': |
613 |
| - # 'name': 'punctuation.section.embedded.begin.php' |
614 |
| - # '1': |
615 |
| - # 'name': 'punctuation.definition.string.php' |
616 |
| - # '3': |
617 |
| - # 'name': 'keyword.operator.heredoc.php' |
618 |
| - # 'contentName': 'source.css' |
619 |
| - # 'end': '^(\\3)\\b' |
620 |
| - # 'endCaptures': |
621 |
| - # '0': |
622 |
| - # 'name': 'punctuation.section.embedded.end.php' |
623 |
| - # '1': |
624 |
| - # 'name': 'keyword.operator.heredoc.php' |
625 |
| - # 'name': 'meta.embedded.css' |
626 |
| - # 'patterns': [ |
627 |
| - # { |
628 |
| - # 'include': 'source.css' |
629 |
| - # } |
630 |
| - # ] |
631 |
| - # } |
632 |
| - # { |
633 |
| - # 'begin': '(<<<)\\s*([\'"]?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\2)' |
634 |
| - # 'beginCaptures': |
635 |
| - # '1': |
636 |
| - # 'name': 'punctuation.definition.string.php' |
637 |
| - # '3': |
638 |
| - # 'name': 'keyword.operator.heredoc.php' |
639 |
| - # 'end': '^(\\3)\\b' |
640 |
| - # 'endCaptures': |
641 |
| - # '1': |
642 |
| - # 'name': 'keyword.operator.heredoc.php' |
643 |
| - # } |
644 |
| - # ] |
| 496 | + 'repository': |
| 497 | + 'heredoc_interior': |
| 498 | + 'patterns': [ |
| 499 | + { |
| 500 | + 'begin': '<<<\\s*([\'"]?)HTML\\1$\\n?' |
| 501 | + 'beginCaptures': |
| 502 | + '0': |
| 503 | + 'name': 'punctuation.section.embedded.begin.php' |
| 504 | + '1': |
| 505 | + 'name': 'punctuation.definition.string.php' |
| 506 | + '3': |
| 507 | + 'name': 'keyword.operator.heredoc.php' |
| 508 | + 'contentName': 'text.html' |
| 509 | + 'end': '^HTML\\b' |
| 510 | + 'endCaptures': |
| 511 | + '0': |
| 512 | + 'name': 'punctuation.section.embedded.end.php' |
| 513 | + '1': |
| 514 | + 'name': 'keyword.operator.heredoc.php' |
| 515 | + 'name': 'meta.embedded.html' |
| 516 | + 'patterns': [ |
| 517 | + { |
| 518 | + 'include': 'text.html.basic' |
| 519 | + } |
| 520 | + ] |
| 521 | + } |
| 522 | + { |
| 523 | + 'begin': '<<<\\s*([\'"]?)XML\\1$\\n?' |
| 524 | + 'beginCaptures': |
| 525 | + '0': |
| 526 | + 'name': 'punctuation.section.embedded.begin.php' |
| 527 | + '1': |
| 528 | + 'name': 'punctuation.definition.string.php' |
| 529 | + '3': |
| 530 | + 'name': 'keyword.operator.heredoc.php' |
| 531 | + 'contentName': 'text.xml' |
| 532 | + 'end': '^XML\\b' |
| 533 | + 'endCaptures': |
| 534 | + '0': |
| 535 | + 'name': 'punctuation.section.embedded.end.php' |
| 536 | + '1': |
| 537 | + 'name': 'keyword.operator.heredoc.php' |
| 538 | + 'name': 'meta.embedded.xml' |
| 539 | + 'patterns': [ |
| 540 | + { |
| 541 | + 'include': 'text.xml' |
| 542 | + } |
| 543 | + ] |
| 544 | + } |
| 545 | + { |
| 546 | + 'begin': '<<<\\s*([\'"]?)SQL\\1$\\n?' |
| 547 | + 'beginCaptures': |
| 548 | + '0': |
| 549 | + 'name': 'punctuation.section.embedded.begin.php' |
| 550 | + '1': |
| 551 | + 'name': 'punctuation.definition.string.php' |
| 552 | + '3': |
| 553 | + 'name': 'keyword.operator.heredoc.php' |
| 554 | + 'contentName': 'source.sql' |
| 555 | + 'end': '^SQL\\b' |
| 556 | + 'endCaptures': |
| 557 | + '0': |
| 558 | + 'name': 'punctuation.section.embedded.end.php' |
| 559 | + '1': |
| 560 | + 'name': 'keyword.operator.heredoc.php' |
| 561 | + 'name': 'meta.embedded.sql' |
| 562 | + 'patterns': [ |
| 563 | + { |
| 564 | + 'include': 'source.sql' |
| 565 | + } |
| 566 | + ] |
| 567 | + } |
| 568 | + { |
| 569 | + 'begin': '<<<\\s*([\'"]?)(JAVASCRIPT|JS)\\1$\\n?' |
| 570 | + 'beginCaptures': |
| 571 | + '0': |
| 572 | + 'name': 'punctuation.section.embedded.begin.php' |
| 573 | + '1': |
| 574 | + 'name': 'punctuation.definition.string.php' |
| 575 | + '3': |
| 576 | + 'name': 'keyword.operator.heredoc.php' |
| 577 | + 'contentName': 'source.js' |
| 578 | + 'end': '^\\2\\b' |
| 579 | + 'endCaptures': |
| 580 | + '0': |
| 581 | + 'name': 'punctuation.section.embedded.end.php' |
| 582 | + '1': |
| 583 | + 'name': 'keyword.operator.heredoc.php' |
| 584 | + 'name': 'meta.embedded.js' |
| 585 | + 'patterns': [ |
| 586 | + { |
| 587 | + 'include': 'source.js' |
| 588 | + } |
| 589 | + ] |
| 590 | + } |
| 591 | + { |
| 592 | + 'begin': '<<<\\s*([\'"]?)JSON\\1$\\n?' |
| 593 | + 'beginCaptures': |
| 594 | + '0': |
| 595 | + 'name': 'punctuation.section.embedded.begin.php' |
| 596 | + '1': |
| 597 | + 'name': 'punctuation.definition.string.php' |
| 598 | + '3': |
| 599 | + 'name': 'keyword.operator.heredoc.php' |
| 600 | + 'contentName': 'source.json' |
| 601 | + 'end': '^JSON\\b' |
| 602 | + 'endCaptures': |
| 603 | + '0': |
| 604 | + 'name': 'punctuation.section.embedded.end.php' |
| 605 | + '1': |
| 606 | + 'name': 'keyword.operator.heredoc.php' |
| 607 | + 'name': 'meta.embedded.json' |
| 608 | + 'patterns': [ |
| 609 | + { |
| 610 | + 'include': 'source.json' |
| 611 | + } |
| 612 | + ] |
| 613 | + } |
| 614 | + { |
| 615 | + 'begin': '<<<\\s*([\'"]?)CSS\\1$\\n?' |
| 616 | + 'beginCaptures': |
| 617 | + '0': |
| 618 | + 'name': 'punctuation.section.embedded.begin.php' |
| 619 | + '1': |
| 620 | + 'name': 'punctuation.definition.string.php' |
| 621 | + '3': |
| 622 | + 'name': 'keyword.operator.heredoc.php' |
| 623 | + 'contentName': 'source.css' |
| 624 | + 'end': '^CSS\\b' |
| 625 | + 'endCaptures': |
| 626 | + '0': |
| 627 | + 'name': 'punctuation.section.embedded.end.php' |
| 628 | + '1': |
| 629 | + 'name': 'keyword.operator.heredoc.php' |
| 630 | + 'name': 'meta.embedded.css' |
| 631 | + 'patterns': [ |
| 632 | + { |
| 633 | + 'include': 'source.css' |
| 634 | + } |
| 635 | + ] |
| 636 | + } |
| 637 | + { |
| 638 | + 'begin': '<<<\\s*([\'"]?)([a-zA-Z_]+[a-zA-Z0-9_]*)\\1' |
| 639 | + 'beginCaptures': |
| 640 | + '1': |
| 641 | + 'name': 'punctuation.definition.string.php' |
| 642 | + '3': |
| 643 | + 'name': 'keyword.operator.heredoc.php' |
| 644 | + 'end': '^\\2\\b' |
| 645 | + 'endCaptures': |
| 646 | + '1': |
| 647 | + 'name': 'keyword.operator.heredoc.php' |
| 648 | + } |
| 649 | + ] |
645 | 650 | 'instantiation':
|
646 | 651 | 'begin': '(?i)(new)\\s+'
|
647 | 652 | 'beginCaptures':
|
|
0 commit comments