|
485 | 485 | </dict> |
486 | 486 | </dict> |
487 | 487 | <key>name</key> |
488 | | - <string>string.quoted.double.puppet</string> |
| 488 | + <string>string.quoted.double.interpolated.puppet</string> |
489 | 489 | <key>patterns</key> |
490 | 490 | <array> |
491 | 491 | <dict> |
|
494 | 494 | </dict> |
495 | 495 | <dict> |
496 | 496 | <key>include</key> |
497 | | - <string>#variable</string> |
| 497 | + <string>#interpolated_puppet</string> |
| 498 | + </dict> |
| 499 | + </array> |
| 500 | + </dict> |
| 501 | + <!-- Ref: https://puppet.com/docs/puppet/latest/lang_data_string.html#short-forms-for-variable-interpolation --> |
| 502 | + <key>interpolated_puppet</key> |
| 503 | + <dict> |
| 504 | + <key>patterns</key> |
| 505 | + <array> |
| 506 | + <!-- These definitions are the #variable matches but expressed as an interpolated string sequence e.g. ${var::foo .... } --> |
| 507 | + <!-- Short variable names can start with underscore e.g. "${_foo1}", "${_foo2.split(..)}" --> |
| 508 | + <dict> |
| 509 | + <key>begin</key> |
| 510 | + <string>(\${)(_[a-zA-Z0-9_]*)</string> |
| 511 | + <key>beginCaptures</key> |
| 512 | + <dict> |
| 513 | + <key>1</key> |
| 514 | + <dict> |
| 515 | + <key>name</key> |
| 516 | + <string>punctuation.section.embedded.begin.puppet</string> |
| 517 | + </dict> |
| 518 | + <key>2</key> |
| 519 | + <dict> |
| 520 | + <key>name</key> |
| 521 | + <string>source.puppet variable.other.readwrite.global.puppet</string> |
| 522 | + </dict> |
| 523 | + </dict> |
| 524 | + <key>end</key> |
| 525 | + <string>}</string> |
| 526 | + <key>endCaptures</key> |
| 527 | + <dict> |
| 528 | + <key>0</key> |
| 529 | + <dict> |
| 530 | + <key>name</key> |
| 531 | + <string>punctuation.section.embedded.end.puppet</string> |
| 532 | + </dict> |
| 533 | + </dict> |
| 534 | + <key>contentName</key> |
| 535 | + <string>source.puppet</string> |
| 536 | + <key>name</key> |
| 537 | + <string>meta.embedded.line.puppet</string> |
| 538 | + <key>patterns</key> |
| 539 | + <array> |
| 540 | + <dict> |
| 541 | + <key>include</key> |
| 542 | + <string>$self</string> |
| 543 | + </dict> |
| 544 | + </array> |
| 545 | + </dict> |
| 546 | + <!-- Qualified variable names (Can't start with underscore) --> |
| 547 | + <dict> |
| 548 | + <key>begin</key> |
| 549 | + <string>(\${)(([a-z][a-z0-9_]*)?(?:::[a-z][a-z0-9_]*)*)</string> |
| 550 | + <key>beginCaptures</key> |
| 551 | + <dict> |
| 552 | + <key>1</key> |
| 553 | + <dict> |
| 554 | + <key>name</key> |
| 555 | + <string>punctuation.section.embedded.begin.puppet</string> |
| 556 | + </dict> |
| 557 | + <key>2</key> |
| 558 | + <dict> |
| 559 | + <key>name</key> |
| 560 | + <string>source.puppet variable.other.readwrite.global.puppet</string> |
| 561 | + </dict> |
| 562 | + </dict> |
| 563 | + <key>end</key> |
| 564 | + <string>}</string> |
| 565 | + <key>endCaptures</key> |
| 566 | + <dict> |
| 567 | + <key>0</key> |
| 568 | + <dict> |
| 569 | + <key>name</key> |
| 570 | + <string>punctuation.section.embedded.end.puppet</string> |
| 571 | + </dict> |
| 572 | + </dict> |
| 573 | + <key>contentName</key> |
| 574 | + <string>source.puppet</string> |
| 575 | + <key>name</key> |
| 576 | + <string>meta.embedded.line.puppet</string> |
| 577 | + <key>patterns</key> |
| 578 | + <array> |
| 579 | + <dict> |
| 580 | + <key>include</key> |
| 581 | + <string>$self</string> |
| 582 | + </dict> |
| 583 | + </array> |
| 584 | + </dict> |
| 585 | + <!-- Catchall. Includes variables with leading $ --> |
| 586 | + <dict> |
| 587 | + <key>begin</key> |
| 588 | + <string>\${</string> |
| 589 | + <key>beginCaptures</key> |
| 590 | + <dict> |
| 591 | + <key>0</key> |
| 592 | + <dict> |
| 593 | + <key>name</key> |
| 594 | + <string>punctuation.section.embedded.begin.puppet</string> |
| 595 | + </dict> |
| 596 | + </dict> |
| 597 | + <key>end</key> |
| 598 | + <string>}</string> |
| 599 | + <key>endCaptures</key> |
| 600 | + <dict> |
| 601 | + <key>0</key> |
| 602 | + <dict> |
| 603 | + <key>name</key> |
| 604 | + <string>punctuation.section.embedded.end.puppet</string> |
| 605 | + </dict> |
| 606 | + </dict> |
| 607 | + <key>contentName</key> |
| 608 | + <string>source.puppet</string> |
| 609 | + <key>name</key> |
| 610 | + <string>meta.embedded.line.puppet</string> |
| 611 | + <key>patterns</key> |
| 612 | + <array> |
| 613 | + <dict> |
| 614 | + <key>include</key> |
| 615 | + <string>$self</string> |
| 616 | + </dict> |
| 617 | + </array> |
498 | 618 | </dict> |
499 | 619 | </array> |
500 | 620 | </dict> |
|
905 | 1025 | </dict> |
906 | 1026 | </array> |
907 | 1027 | </dict> |
| 1028 | + <!-- Ref: https://puppet.com/docs/puppet/latest/lang_variables.html#regular-expressions-for-variable-names --> |
908 | 1029 | <key>variable</key> |
909 | 1030 | <dict> |
910 | 1031 | <key>patterns</key> |
911 | 1032 | <array> |
| 1033 | + <!--Short variable names can start with underscore --> |
912 | 1034 | <dict> |
| 1035 | + <key>match</key> |
| 1036 | + <string>(\$)_[a-zA-Z0-9_]*</string> |
| 1037 | + <key>name</key> |
| 1038 | + <string>variable.other.readwrite.global.puppet</string> |
913 | 1039 | <key>captures</key> |
914 | 1040 | <dict> |
915 | 1041 | <key>1</key> |
|
918 | 1044 | <string>punctuation.definition.variable.puppet</string> |
919 | 1045 | </dict> |
920 | 1046 | </dict> |
| 1047 | + </dict> |
| 1048 | + <!-- Qualified variable names (Can't start with underscore) --> |
| 1049 | + <dict> |
921 | 1050 | <key>match</key> |
922 | | - <string>(\$)((::)?[a-z]\w*)*((::)?[a-z_]\w*)\b</string> |
| 1051 | + <string>(\$)(([a-z][a-z0-9_]*)?(?:::[a-z][a-z0-9_]*)*)</string> |
923 | 1052 | <key>name</key> |
924 | 1053 | <string>variable.other.readwrite.global.puppet</string> |
925 | | - </dict> |
926 | | - <dict> |
927 | 1054 | <key>captures</key> |
928 | 1055 | <dict> |
929 | 1056 | <key>1</key> |
930 | 1057 | <dict> |
931 | 1058 | <key>name</key> |
932 | 1059 | <string>punctuation.definition.variable.puppet</string> |
933 | 1060 | </dict> |
934 | | - <key>2</key> |
935 | | - <dict> |
936 | | - <key>name</key> |
937 | | - <string>punctuation.definition.variable.puppet</string> |
938 | | - </dict> |
939 | 1061 | </dict> |
940 | | - <key>match</key> |
941 | | - <string>(\$\{)(?:[a-zA-Zx7f-xff\$]|::)(?:[a-zA-Z0-9_x7f-xff\$]|::)*(\})</string> |
942 | | - <key>name</key> |
943 | | - <string>variable.other.readwrite.global.puppet</string> |
944 | 1062 | </dict> |
945 | 1063 | </array> |
946 | 1064 | </dict> |
|
0 commit comments