Skip to content

Commit

Permalink
Change PHP include root scope
Browse files Browse the repository at this point in the history
The root scope of PHP has changed in TextMate 2 due to it's usage. Also allow PHP grammar to match tags to improve matching.
  • Loading branch information
infininight committed Jun 30, 2016
1 parent a6c68b4 commit 29ea1d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 113 deletions.
35 changes: 5 additions & 30 deletions Syntaxes/Movable Type (MT only).tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -239,40 +239,15 @@
</dict>
<key>php</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>&lt;\?(php|=)?</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.embedded.php</string>
</dict>
</dict>
<key>end</key>
<string>\?&gt;</string>
<key>name</key>
<string>source.php.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#php-source</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>php-source</key>
<dict>
<key>begin</key>
<string>(?=(^\s*)?&lt;\?)</string>
<key>end</key>
<string>(?!(^\s*)?&lt;\?)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.php</string>
<string>text.html.php</string>
</dict>
</array>
</dict>
Expand Down
88 changes: 5 additions & 83 deletions Syntaxes/Movable Type.plist
Original file line number Diff line number Diff line change
Expand Up @@ -198,93 +198,15 @@
</dict>
<key>php</key>
<dict>
<key>begin</key>
<string>(?=(^\s*)?&lt;\?)</string>
<key>end</key>
<string>(?!(^\s*)?&lt;\?)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(?:^\s*)(&lt;\?(php|=)?)(?!.*\?&gt;)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.section.embedded.php</string>
</dict>
</dict>
<key>comment</key>
<string>match only multi-line PHP with leading whitespace</string>
<key>end</key>
<string>(\?&gt;)(?:\s*$\n)?</string>
<key>name</key>
<string>source.php.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#php-source</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>&lt;\?(php|=)?</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.embedded.php</string>
</dict>
</dict>
<key>end</key>
<string>\?&gt;</string>
<key>name</key>
<string>source.php.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#php-source</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>php-source</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.php</string>
</dict>
</dict>
<key>match</key>
<string>(#).*?(?=\?&gt;)</string>
<key>name</key>
<string>comment.line.number-sign.ruby</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.php</string>
</dict>
</dict>
<key>match</key>
<string>(//).*?(?=\?&gt;)</string>
<key>name</key>
<string>comment.line.double-slash.ruby</string>
</dict>
<dict>
<key>include</key>
<string>source.php</string>
<string>text.html.php</string>
</dict>
</array>
</dict>
Expand Down

0 comments on commit 29ea1d3

Please sign in to comment.