|
16 | 16 | <string>PHP</string> |
17 | 17 | <key>patterns</key> |
18 | 18 | <array> |
| 19 | + <dict> |
| 20 | + <key>captures</key> |
| 21 | + <dict> |
| 22 | + <key>1</key> |
| 23 | + <dict> |
| 24 | + <key>name</key> |
| 25 | + <string>punctuation.whitespace.embedded.leading.php</string> |
| 26 | + </dict> |
| 27 | + <key>2</key> |
| 28 | + <dict> |
| 29 | + <key>name</key> |
| 30 | + <string>source.php.embedded.line.empty.html</string> |
| 31 | + </dict> |
| 32 | + <key>3</key> |
| 33 | + <dict> |
| 34 | + <key>name</key> |
| 35 | + <string>punctuation.definition.embedded.begin.php</string> |
| 36 | + </dict> |
| 37 | + <key>4</key> |
| 38 | + <dict> |
| 39 | + <key>name</key> |
| 40 | + <string>meta.consecutive-tags.php</string> |
| 41 | + </dict> |
| 42 | + <key>5</key> |
| 43 | + <dict> |
| 44 | + <key>name</key> |
| 45 | + <string>source.php</string> |
| 46 | + </dict> |
| 47 | + <key>6</key> |
| 48 | + <dict> |
| 49 | + <key>name</key> |
| 50 | + <string>punctuation.definition.embedded.end.php</string> |
| 51 | + </dict> |
| 52 | + <key>7</key> |
| 53 | + <dict> |
| 54 | + <key>name</key> |
| 55 | + <string>source.php</string> |
| 56 | + </dict> |
| 57 | + <key>8</key> |
| 58 | + <dict> |
| 59 | + <key>name</key> |
| 60 | + <string>punctuation.whitespace.embedded.trailing.php</string> |
| 61 | + </dict> |
| 62 | + </dict> |
| 63 | + <key>comment</key> |
| 64 | + <string>Matches empty tags.</string> |
| 65 | + <key>match</key> |
| 66 | + <string>(?x) |
| 67 | + (^\s*)? # 1 - Leading whitespace |
| 68 | + ( # 2 - meta.embedded.line.empty.php |
| 69 | + ( # 3 - Open Tag |
| 70 | + (?: |
| 71 | + ((?<=\?>)<) # 4 - Consecutive tags |
| 72 | + | < |
| 73 | + ) |
| 74 | + \?(?i:php|=)? |
| 75 | + ) |
| 76 | + (\s*) # 5 - Loneliness |
| 77 | + ((\?)>) # 6 - Close Tag |
| 78 | + # 7 - Scope ? as scope.php |
| 79 | + ) |
| 80 | + ( |
| 81 | + \1 # Match nothing if there was no |
| 82 | + # leading whitespace... |
| 83 | + | (\s*$\n)? # or match trailing whitespace. |
| 84 | + ) |
| 85 | + </string> |
| 86 | + </dict> |
| 87 | + <dict> |
| 88 | + <key>begin</key> |
| 89 | + <string>^\s*(?=<\?)</string> |
| 90 | + <key>beginCaptures</key> |
| 91 | + <dict> |
| 92 | + <key>0</key> |
| 93 | + <dict> |
| 94 | + <key>name</key> |
| 95 | + <string>punctuation.whitespace.embedded.leading.php</string> |
| 96 | + </dict> |
| 97 | + </dict> |
| 98 | + <key>comment</key> |
| 99 | + <string>Catches tags with preceeding whitespace.</string> |
| 100 | + <key>end</key> |
| 101 | + <string>(?<=\?>)(\s*$\n)?</string> |
| 102 | + <key>endCaptures</key> |
| 103 | + <dict> |
| 104 | + <key>0</key> |
| 105 | + <dict> |
| 106 | + <key>name</key> |
| 107 | + <string>punctuation.whitespace.embedded.trailing.php</string> |
| 108 | + </dict> |
| 109 | + </dict> |
| 110 | + <key>patterns</key> |
| 111 | + <array> |
| 112 | + <dict> |
| 113 | + <key>begin</key> |
| 114 | + <string><\?(?i:php|=)?</string> |
| 115 | + <key>beginCaptures</key> |
| 116 | + <dict> |
| 117 | + <key>0</key> |
| 118 | + <dict> |
| 119 | + <key>name</key> |
| 120 | + <string>punctuation.definition.embedded.begin.php</string> |
| 121 | + </dict> |
| 122 | + </dict> |
| 123 | + <key>end</key> |
| 124 | + <string>(\?)></string> |
| 125 | + <key>endCaptures</key> |
| 126 | + <dict> |
| 127 | + <key>0</key> |
| 128 | + <dict> |
| 129 | + <key>name</key> |
| 130 | + <string>punctuation.definition.embedded.end.php</string> |
| 131 | + </dict> |
| 132 | + <key>1</key> |
| 133 | + <dict> |
| 134 | + <key>name</key> |
| 135 | + <string>source.php</string> |
| 136 | + </dict> |
| 137 | + </dict> |
| 138 | + <key>name</key> |
| 139 | + <string>source.php.embedded.block.html</string> |
| 140 | + <key>patterns</key> |
| 141 | + <array> |
| 142 | + <dict> |
| 143 | + <key>include</key> |
| 144 | + <string>#language</string> |
| 145 | + </dict> |
| 146 | + </array> |
| 147 | + </dict> |
| 148 | + </array> |
| 149 | + </dict> |
19 | 150 | <dict> |
20 | 151 | <key>begin</key> |
21 | | - <string><\?(?i:php|=)?</string> |
| 152 | + <string>(((?<=\?>)<)|<)\?(?i:php|=)?</string> |
22 | 153 | <key>beginCaptures</key> |
23 | 154 | <dict> |
24 | 155 | <key>0</key> |
25 | 156 | <dict> |
26 | 157 | <key>name</key> |
27 | | - <string>punctuation.section.embedded.begin.php</string> |
| 158 | + <string>punctuation.definition.embedded.begin.php</string> |
| 159 | + </dict> |
| 160 | + <key>2</key> |
| 161 | + <dict> |
| 162 | + <key>name</key> |
| 163 | + <string>meta.consecutive-tags.php</string> |
28 | 164 | </dict> |
29 | 165 | </dict> |
| 166 | + <key>comment</key> |
| 167 | + <string>Catches the remainder.</string> |
30 | 168 | <key>end</key> |
31 | | - <string>\?></string> |
| 169 | + <string>(\?)></string> |
32 | 170 | <key>endCaptures</key> |
33 | 171 | <dict> |
34 | 172 | <key>0</key> |
35 | 173 | <dict> |
36 | 174 | <key>name</key> |
37 | | - <string>punctuation.section.embedded.end.php</string> |
| 175 | + <string>punctuation.definition.embedded.end.php</string> |
| 176 | + </dict> |
| 177 | + <key>1</key> |
| 178 | + <dict> |
| 179 | + <key>name</key> |
| 180 | + <string>source.php</string> |
38 | 181 | </dict> |
39 | 182 | </dict> |
| 183 | + <key>name</key> |
| 184 | + <string>source.php.embedded.line.html</string> |
40 | 185 | <key>patterns</key> |
41 | 186 | <array> |
42 | 187 | <dict> |
|
0 commit comments