-
-
Save NoxArt/1736334 to your computer and use it in GitHub Desktop.
Latte syntax definition for Sublime Text 2 [#nettefw #latte #php]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<!-- | |
- @author Michal Mikoláš <[email protected]> | |
- @author Jiri Petruzelka <[email protected]> | |
- @license CC BY <http://creativecommons.org/licenses/by/3.0/cz/> | |
--> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>phtml</string> | |
<string>latte</string> | |
</array> | |
<key>name</key> | |
<string>Latte</string> | |
<key>scopeName</key> | |
<string>source.latte</string> | |
<key>patterns</key> | |
<array> | |
<dict> <!-- Whatever between { and } --> | |
<key>begin</key> | |
<string>\{\{?(?!\s)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.tag.begin.latte</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\}?\}</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.tag.end.latte</string> | |
</dict> | |
</dict> | |
<key>name</key> | |
<string>source.latte</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>(?<=\{)\*</string> | |
<key>captures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.comment.latte</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\*(?=\})</string> | |
<key>name</key> | |
<string>comment.block.latte</string> | |
</dict> | |
<dict> <!-- Unescaped --> | |
<key>match</key> | |
<string>(?<=\{)(\![^}]*)</string> | |
<key>name</key> | |
<string>keyword.unescaped.latte</string> | |
</dict> | |
<dict> <!-- Pair latte macros --> | |
<key>match</key> | |
<string>(?<=\{)/?(block|foreach|form|ifset|elseif|if|else|snippet|ifCurrent|for|foreach|while|first|last|sep|capture|cache|syntaxblock|syntax|define)\s*</string> | |
<key>name</key> | |
<string>keyword.control.latte</string> | |
</dict> | |
<dict> <!-- Single latte macros --> | |
<key>match</key> | |
<string>(?<=\{)(var|link|plink|control|\!|label|input|default|include|l|r|use|contentType|status|_|layout|extends|dump|debugbreak)\s*</string> | |
<key>name</key> | |
<string>keyword.operator.latte</string> | |
</dict> | |
<!-- | |
<dict> | |
<key>match</key> | |
<string>\!|and|or|===|>=|<=|<>|>|<|==|!==|true|false</string> | |
<key>name</key> | |
<string>keyword.?.latte</string> | |
</dict> | |
--> | |
<dict> <!-- Latte variables --> | |
<key>match</key> | |
<string>\$\$?[a-zA-Z_0-9]+\s*</string> | |
<key>name</key> | |
<string>variable.other.global.latte</string> | |
</dict> | |
<dict> <!-- Deprecated keywords --> | |
<key>match</key> | |
<string>widget</string> | |
<key>name</key> | |
<string>invalid.deprecated</string> | |
</dict> | |
<dict> <!-- Helpers --> | |
<key>match</key> | |
<string>.*?(\|)(\w+)(?:\:(["'\w]+))*</string> <!-- matches only last argument - why? --> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.helper.separator.latte</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.helper.name.latte</string> | |
</dict> | |
<!-- | |
<key>3</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.helper.argument.latte</string> | |
</dict> | |
--> | |
</dict> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>.*?(["'].*?["'])</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>string</string> | |
</dict> | |
</dict> | |
</dict> | |
<dict> <!-- Whatever else between { and } --> | |
<key>match</key> | |
<string>([^}$]|\s)*</string> | |
<key>name</key> | |
<string>source.latte</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> <!-- Include HTML highlight --> | |
<key>include</key> | |
<string>text.html.basic</string> | |
</dict> | |
</array> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment