├── settings └── language-smarty.php.cson ├── CHANGELOG.md ├── spec ├── atom-fis3-smarty-view-spec.coffee └── atom-fis3-smarty-spec.coffee ├── README.md ├── styles └── atom-fis3-smarty.less ├── keymaps └── atom-fis3-smarty.cson ├── package.json ├── menus └── atom-fis3-smarty.cson ├── lib ├── atom-fis3-smarty-view.coffee └── atom-fis3-smarty.coffee ├── .gitignore ├── LICENSE.md ├── LICENSE ├── snippets ├── language-smarty-php.cson └── language-smarty-php-1.cson └── grammars └── smarty.cson /settings/language-smarty.php.cson: -------------------------------------------------------------------------------- 1 | '.source.smarty': 2 | 'editor': 3 | 'commentStart': '{* ' 4 | 'commentEnd': ' *}' 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.0 - First Release 2 | * Syntax highlight of Smarty 3 | * Some snippets of Smarty 4 | * include html` plugin tag 5 | -------------------------------------------------------------------------------- /spec/atom-fis3-smarty-view-spec.coffee: -------------------------------------------------------------------------------- 1 | AtomFis3SmartyView = require '../lib/atom-fis3-smarty-view' 2 | 3 | describe "AtomFis3SmartyView", -> 4 | it "has one valid test", -> 5 | expect("life").toBe "easy" 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # atom-fis3-smarty package 2 | 3 | highlight for smarty and some features of FIS. 4 | 5 | ![A screenshot of your package](https://f.cloud.github.com/assets/69169/2290250/c35d867a-a017-11e3-86be-cd7c5bf3ff9b.gif) 6 | -------------------------------------------------------------------------------- /styles/atom-fis3-smarty.less: -------------------------------------------------------------------------------- 1 | // The ui-variables file is provided by base themes provided by Atom. 2 | // 3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less 4 | // for a full listing of what's available. 5 | @import "ui-variables"; 6 | 7 | .atom-fis3-smarty { 8 | } 9 | -------------------------------------------------------------------------------- /keymaps/atom-fis3-smarty.cson: -------------------------------------------------------------------------------- 1 | # Keybindings require three things to be fully defined: A selector that is 2 | # matched against the focused element, the keystroke and the command to 3 | # execute. 4 | # 5 | # Below is a basic keybinding which registers on all platforms by applying to 6 | # the root workspace element. 7 | 8 | # For more detailed documentation see 9 | # https://atom.io/docs/latest/behind-atom-keymaps-in-depth 10 | 'atom-workspace': 11 | 'ctrl-alt-o': 'atom-fis3-smarty:hello' 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atom-fis3-smarty", 3 | "main": "./lib/atom-fis3-smarty", 4 | "version": "0.1.1", 5 | "description": "highlight for smarty and some features of FIS.", 6 | "keywords": [ 7 | ], 8 | "activationCommands": { 9 | "atom-workspace": "atom-fis3-smarty:hello" 10 | }, 11 | "repository": "https://github.com/xiangshouding/atom-fis3-smarty", 12 | "license": "MIT", 13 | "engines": { 14 | "atom": ">=1.0.0 <2.0.0" 15 | }, 16 | "dependencies": { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /menus/atom-fis3-smarty.cson: -------------------------------------------------------------------------------- 1 | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 2 | 'context-menu': 3 | 'atom-text-editor': [ 4 | { 5 | 'label': 'hello by fis' 6 | 'command': 'atom-fis3-smarty:hello' 7 | } 8 | { 9 | 'label': 'release with fis-conf.js' 10 | 'command': 'atom-fis3-smarty:release' 11 | } 12 | ] 13 | 'menu': [ 14 | { 15 | 'label': 'Packages' 16 | 'submenu': [ 17 | 'label': 'atom-fis3-smarty' 18 | 'submenu': [ 19 | { 20 | 'label': 'show hello' 21 | 'command': 'atom-fis3-smarty:hello' 22 | } 23 | ] 24 | ] 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /lib/atom-fis3-smarty-view.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | class AtomFis3SmartyView 3 | constructor: (serializedState) -> 4 | # Create root element 5 | @element = document.createElement('div') 6 | @element.classList.add('atom-fis3-smarty') 7 | 8 | # Create message element 9 | message = document.createElement('div') 10 | message.textContent = "Hello, FIS" 11 | message.classList.add('message') 12 | @element.appendChild(message) 13 | 14 | # Returns an object that can be retrieved when package is activated 15 | serialize: -> 16 | 17 | # Tear down any state and detach 18 | destroy: -> 19 | @element.remove() 20 | 21 | getElement: -> 22 | @element 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | .DS_Store 3 | npm-debug.log 4 | ======= 5 | # Logs 6 | logs 7 | *.log 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directory 30 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 31 | >>>>>>> fa9e13620e5edb112d1791e2895c5d34ea6415c2 32 | node_modules 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/atom-fis3-smarty.coffee: -------------------------------------------------------------------------------- 1 | AtomFis3SmartyView = require './atom-fis3-smarty-view' 2 | {CompositeDisposable} = require 'atom' 3 | 4 | module.exports = AtomFis3Smarty = 5 | atomFis3SmartyView: null 6 | modalPanel: null 7 | subscriptions: null 8 | 9 | activate: (state) -> 10 | @atomFis3SmartyView = new AtomFis3SmartyView(state.atomFis3SmartyViewState) 11 | @modalPanel = atom.workspace.addModalPanel(item: @atomFis3SmartyView.getElement(), visible: false) 12 | 13 | # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable 14 | @subscriptions = new CompositeDisposable 15 | 16 | # Register command that toggles this view 17 | @subscriptions.add atom.commands.add 'atom-workspace', 'atom-fis3-smarty:hello' : => @hello() 18 | 19 | deactivate: -> 20 | @modalPanel.destroy() 21 | @subscriptions.dispose() 22 | @atomFis3SmartyView.destroy() 23 | 24 | serialize: -> 25 | atomFis3SmartyViewState: @atomFis3SmartyView.serialize() 26 | 27 | hello: -> 28 | console.log 'hello' 29 | if @modalPanel.isVisible() 30 | @modalPanel.hide() 31 | else 32 | @modalPanel.show() 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, fansekey 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /spec/atom-fis3-smarty-spec.coffee: -------------------------------------------------------------------------------- 1 | AtomFis3Smarty = require '../lib/atom-fis3-smarty' 2 | 3 | # Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs. 4 | # 5 | # To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit` 6 | # or `fdescribe`). Remove the `f` to unfocus the block. 7 | 8 | describe "AtomFis3Smarty", -> 9 | [workspaceElement, activationPromise] = [] 10 | 11 | beforeEach -> 12 | workspaceElement = atom.views.getView(atom.workspace) 13 | activationPromise = atom.packages.activatePackage('atom-fis3-smarty') 14 | 15 | describe "when the atom-fis3-smarty:toggle event is triggered", -> 16 | it "hides and shows the modal panel", -> 17 | # Before the activation event the view is not on the DOM, and no panel 18 | # has been created 19 | expect(workspaceElement.querySelector('.atom-fis3-smarty')).not.toExist() 20 | 21 | # This is an activation event, triggering it will cause the package to be 22 | # activated. 23 | atom.commands.dispatch workspaceElement, 'atom-fis3-smarty:toggle' 24 | 25 | waitsForPromise -> 26 | activationPromise 27 | 28 | runs -> 29 | expect(workspaceElement.querySelector('.atom-fis3-smarty')).toExist() 30 | 31 | atomFis3SmartyElement = workspaceElement.querySelector('.atom-fis3-smarty') 32 | expect(atomFis3SmartyElement).toExist() 33 | 34 | atomFis3SmartyPanel = atom.workspace.panelForItem(atomFis3SmartyElement) 35 | expect(atomFis3SmartyPanel.isVisible()).toBe true 36 | atom.commands.dispatch workspaceElement, 'atom-fis3-smarty:toggle' 37 | expect(atomFis3SmartyPanel.isVisible()).toBe false 38 | 39 | it "hides and shows the view", -> 40 | # This test shows you an integration test testing at the view level. 41 | 42 | # Attaching the workspaceElement to the DOM is required to allow the 43 | # `toBeVisible()` matchers to work. Anything testing visibility or focus 44 | # requires that the workspaceElement is on the DOM. Tests that attach the 45 | # workspaceElement to the DOM are generally slower than those off DOM. 46 | jasmine.attachToDOM(workspaceElement) 47 | 48 | expect(workspaceElement.querySelector('.atom-fis3-smarty')).not.toExist() 49 | 50 | # This is an activation event, triggering it causes the package to be 51 | # activated. 52 | atom.commands.dispatch workspaceElement, 'atom-fis3-smarty:toggle' 53 | 54 | waitsForPromise -> 55 | activationPromise 56 | 57 | runs -> 58 | # Now we can test for view visibility 59 | atomFis3SmartyElement = workspaceElement.querySelector('.atom-fis3-smarty') 60 | expect(atomFis3SmartyElement).toBeVisible() 61 | atom.commands.dispatch workspaceElement, 'atom-fis3-smarty:toggle' 62 | expect(atomFis3SmartyElement).not.toBeVisible() 63 | -------------------------------------------------------------------------------- /snippets/language-smarty-php.cson: -------------------------------------------------------------------------------- 1 | '.source.smarty': 2 | 'Assign': 3 | 'prefix': '{assign' 4 | 'body': '{assign var=$1 value=$2' 5 | 'Capitalize': 6 | 'prefix': '|cap' 7 | 'body': '|capitalize' 8 | 'Capture': 9 | 'prefix': '{capture' 10 | 'body': '{capture${1: name=$2}${3: assign=$4}}$0{/capture' 11 | 'Cat': 12 | 'prefix': '|cat' 13 | 'body': '|cat:"${1:lorem ipsum}"' 14 | 'Config Load': 15 | 'prefix': '{config_load' 16 | 'body': '{config_load file="$1"${2: section="$3"}${4: scope="${5:local|parent|global}"}' 17 | 'Count Characters': 18 | 'prefix': '|count' 19 | 'body': '|count_characters' 20 | 'Count Paragraphs': 21 | 'prefix': '|count' 22 | 'body': '|count_paragraphs' 23 | 'Count Sentences': 24 | 'prefix': '|count' 25 | 'body': '|count_sentences' 26 | 'Count Words': 27 | 'prefix': '|count' 28 | 'body': '|count_words' 29 | 'Counter': 30 | 'prefix': '{counter' 31 | 'body': '{counter name="$1" start=${2:1}${3: skip=${4:2}}${5: assign="${6}"}' 32 | 'Cycle': 33 | 'prefix': '{cycle' 34 | 'body': '{cycle values="${1:on},${2:off}"${3: name="${4:name}"}' 35 | 'Date Format': 36 | 'prefix': '|format' 37 | 'body': '|date_format:"${1:%b %e, %Y}"' 38 | 'Default': 39 | 'prefix': '|def' 40 | 'body': '|default:"$1" ' 41 | 'Escape': 42 | 'prefix': '|esc' 43 | 'body': '|escape:"${1:|htmlall|url|quotes|hex|hexentity|javascript}" ' 44 | 'Fetch': 45 | 'prefix': '{fetch' 46 | 'body': '{fetch file="${1:filename}"${2: assign=${3:var}}' 47 | 'Foreach': 48 | 'prefix': '{foreach' 49 | 'body': '{foreach from=\\$${1:varname} item=${2:item}${3: key=${4:key}}${5: name=${6:loop1}}}\n\t$0\n{/foreach' 50 | 'If': 51 | 'prefix': '{if' 52 | 'body': '{if $1}\n\t$0\n{/if' 53 | 'Include': 54 | 'prefix': '{inc' 55 | 'body': '{include file="$1"${2: assign=${3:var}}' 56 | 'Ldelim': 57 | 'prefix': '{ld' 58 | 'body': '{ldelim' 59 | 'Literal': 60 | 'prefix': '{lit' 61 | 'body': '{literal}$1{/literal' 62 | 'Math': 63 | 'prefix': '{math' 64 | 'body': '{math equation="${1:1+x}" assign=$2 ${3:x=8}' 65 | 'Rdelim': 66 | 'prefix': '{rd' 67 | 'body': '{rdelim}' 68 | 'Regex Replace': 69 | 'prefix': '|regex' 70 | 'body': '|regex_replace:"/${1:.*}/":"$2"' 71 | 'Replace': 72 | 'prefix': '|replace' 73 | 'body': '|replace:"${1:needle}":"$2" ' 74 | 'String Format': 75 | 'prefix': '|format' 76 | 'body': '|string_format:"${1:%.2f}"' 77 | 'Strip': 78 | 'prefix': '{strip' 79 | 'body': '{strip}\n\t$1\n{/strip' 80 | 'Strip Tags': 81 | 'prefix': '|strip' 82 | 'body': '|strip_tags' 83 | 'Truncate': 84 | 'prefix': '|trunc' 85 | 'body': '|truncate:${1:80}:${2:"…"}:${3:false}' 86 | 'Word Wrap': 87 | 'prefix': '|wrap' 88 | 'body': '|wordwrap:${1:80}${2::"${3:\\n}"}' 89 | 'Html': 90 | 'prefix': '{html' 91 | 'body': '{html framework="${1:mod.js}"' 92 | -------------------------------------------------------------------------------- /snippets/language-smarty-php-1.cson: -------------------------------------------------------------------------------- 1 | '.source.smarty': 2 | 'Assign': 3 | 'prefix': '{%assign' 4 | 'body': '{%assign var=$1 value=$2' 5 | 'Capitalize': 6 | 'prefix': '|cap' 7 | 'body': '|capitalize' 8 | 'Capture': 9 | 'prefix': '{%capture' 10 | 'body': '{%capture${1: name=$2}${3: assign=$4}}$0{/capture' 11 | 'Cat': 12 | 'prefix': '|cat' 13 | 'body': '|cat:"${1:lorem ipsum}"' 14 | 'Config Load': 15 | 'prefix': '{%config_load' 16 | 'body': '{%config_load file="$1"${2: section="$3"}${4: scope="${5:local|parent|global}"}' 17 | 'Count Characters': 18 | 'prefix': '|count' 19 | 'body': '|count_characters' 20 | 'Count Paragraphs': 21 | 'prefix': '|count' 22 | 'body': '|count_paragraphs' 23 | 'Count Sentences': 24 | 'prefix': '|count' 25 | 'body': '|count_sentences' 26 | 'Count Words': 27 | 'prefix': '|count' 28 | 'body': '|count_words' 29 | 'Counter': 30 | 'prefix': '{%counter' 31 | 'body': '{%counter name="$1" start=${2:1}${3: skip=${4:2}}${5: assign="${6}"}' 32 | 'Cycle': 33 | 'prefix': '{%cycle' 34 | 'body': '{%cycle values="${1:on},${2:off}"${3: name="${4:name}"}' 35 | 'Date Format': 36 | 'prefix': '|format' 37 | 'body': '|date_format:"${1:%b %e, %Y}"' 38 | 'Default': 39 | 'prefix': '|def' 40 | 'body': '|default:"$1" ' 41 | 'Escape': 42 | 'prefix': '|esc' 43 | 'body': '|escape:"${1:|htmlall|url|quotes|hex|hexentity|javascript}" ' 44 | 'Fetch': 45 | 'prefix': '{%fetch' 46 | 'body': '{%fetch file="${1:filename}"${2: assign=${3:var}}' 47 | 'Foreach': 48 | 'prefix': '{%foreach' 49 | 'body': '{%foreach from=\\$${1:varname} item=${2:item}${3: key=${4:key}}${5: name=${6:loop1}}}\n\t$0\n{/foreach' 50 | 'If': 51 | 'prefix': '{%if' 52 | 'body': '{%if $1}\n\t$0\n{/if' 53 | 'Include': 54 | 'prefix': '{%inc' 55 | 'body': '{%include file="$1"${2: assign=${3:var}}' 56 | 'Ldelim': 57 | 'prefix': '{%ld' 58 | 'body': '{%ldelim' 59 | 'Literal': 60 | 'prefix': '{%lit' 61 | 'body': '{%literal}$1{/literal' 62 | 'Math': 63 | 'prefix': '{%math' 64 | 'body': '{%math equation="${1:1+x}" assign=$2 ${3:x=8}' 65 | 'Rdelim': 66 | 'prefix': '{%rd' 67 | 'body': '{%rdelim}' 68 | 'Regex Replace': 69 | 'prefix': '|regex' 70 | 'body': '|regex_replace:"/${1:.*}/":"$2"' 71 | 'Replace': 72 | 'prefix': '|replace' 73 | 'body': '|replace:"${1:needle}":"$2" ' 74 | 'String Format': 75 | 'prefix': '|format' 76 | 'body': '|string_format:"${1:%.2f}"' 77 | 'Strip': 78 | 'prefix': '{%strip' 79 | 'body': '{%strip}\n\t$1\n{/strip' 80 | 'Strip Tags': 81 | 'prefix': '|strip' 82 | 'body': '|strip_tags' 83 | 'Truncate': 84 | 'prefix': '|trunc' 85 | 'body': '|truncate:${1:80}:${2:"…"}:${3:false}' 86 | 'Word Wrap': 87 | 'prefix': '|wrap' 88 | 'body': '|wordwrap:${1:80}${2::"${3:\\n}"}' 89 | 'Html': 90 | 'prefix': '{%html' 91 | 'body': '{%html framework="${1:mod.js}"%' 92 | -------------------------------------------------------------------------------- /grammars/smarty.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': ['tpl'] 2 | 'foldingStartMarker': '((?:<|\\{%?)(?i:(html|head|table|tr|div|style|script|ul|ol|form|dl))\\b.*?>|\\{\\{?(if|foreach|capture|literal|foreach|php|section|strip)|\\{\\s*$)' 3 | 'foldingStopMarker': '((?:|\\{\\{?/(if|foreach|capture|literal|foreach|php|section|strip)|(^|\\s)\\})' 4 | 'name': 'Smarty (by FIS)', 5 | 'patterns': [ 6 | { 7 | "include": "text.html.basic" 8 | }, 9 | { 10 | 'begin': '(?<=\\{)\\*' 11 | 'captures': 12 | '0': 13 | 'name': 'punctuation.definition.comment.smarty' 14 | 'end': '\\*(?=\\})' 15 | 'name': 'comment.block.smarty' 16 | } 17 | { 18 | 'match': '\\b(if|else|elseif|foreach|foreachelse|section)\\b' 19 | 'name': 'keyword.control.smarty' 20 | } 21 | { 22 | 'match': '\\b(capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|html_[a-z_]*)\\b' 23 | 'name': 'support.function.built-in.smarty' 24 | } 25 | { 26 | 'match': '\\b(and|or)\\b' 27 | 'name': 'keyword.operator.smarty' 28 | } 29 | { 30 | 'match': '\\b(eq|neq|gt|lt|gte|lte|is|not|even|odd|not|mod|div|by)\\b' 31 | 'name': 'keyword.operator.other.smarty' 32 | } 33 | { 34 | 'match': '\\|(capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)' 35 | 'name': 'support.function.variable-modifier.smarty' 36 | } 37 | { 38 | 'match': '\\b[a-zA-Z]+=' 39 | 'name': 'meta.attribute.smarty' 40 | } 41 | { 42 | 'begin': '\'' 43 | 'beginCaptures': 44 | '0': 45 | 'name': 'punctuation.definition.string.begin.smarty' 46 | 'end': '\'' 47 | 'endCaptures': 48 | '0': 49 | 'name': 'punctuation.definition.string.end.smarty' 50 | 'name': 'string.quoted.single.smarty' 51 | 'patterns': [ 52 | { 53 | 'match': '\\\\.' 54 | 'name': 'constant.character.escape.smarty' 55 | } 56 | ] 57 | } 58 | { 59 | 'begin': '"' 60 | 'beginCaptures': 61 | '0': 62 | 'name': 'punctuation.definition.string.begin.smarty' 63 | 'end': '"' 64 | 'endCaptures': 65 | '0': 66 | 'name': 'punctuation.definition.string.end.smarty' 67 | 'name': 'string.quoted.double.smarty' 68 | 'patterns': [ 69 | { 70 | 'match': '\\\\.' 71 | 'name': 'constant.character.escape.smarty' 72 | } 73 | ] 74 | } 75 | { 76 | 'captures': 77 | '1': 78 | 'name': 'punctuation.definition.variable.smarty' 79 | 'match': '\\b(\\$)Smarty\\.' 80 | 'name': 'variable.other.global.smarty' 81 | } 82 | { 83 | 'captures': 84 | '1': 85 | 'name': 'punctuation.definition.variable.smarty' 86 | 'match': '(\\$)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*?\\b' 87 | 'name': 'variable.other.smarty' 88 | } 89 | { 90 | 'match': '\\b(TRUE|FALSE|true|false)\\b' 91 | 'name': 'constant.language.smarty' 92 | } 93 | { 94 | 'begin': '(?:^\\s+)?(\\{%?)((?i:style))\\b(?!(?:(?!%?\\})[\s\S])*/>)' 95 | 'captures': 96 | '1': 97 | 'name': 'punctuation.definition.tag.html' 98 | '2': 99 | 'name': 'entity.name.tag.style.html' 100 | '3': 101 | 'name': 'punctuation.definition.tag.html' 102 | 'end': '(\\{%?/)((?i:style))(%?\\})(?:\\s*\\n)?' 103 | 'name': 'source.css.embedded.html' 104 | 'patterns': [ 105 | { 106 | 'begin': '(%?\\})' 107 | 'beginCaptures': 108 | '1': 109 | 'name': 'punctuation.definition.tag.html' 110 | 'end': '(?=\\{%?/(?i:style))' 111 | 'patterns': [ 112 | { 113 | 'include': 'source.css' 114 | } 115 | ] 116 | } 117 | ] 118 | } 119 | { 120 | 'begin': '(?:^\\s+)?(\\{%?)((?i:script))\\b(?!(?:(?!%?\\})[\s\S])*/>)' 121 | 'captures': 122 | '1': 123 | 'name': 'punctuation.definition.tag.html' 124 | '2': 125 | 'name': 'entity.name.tag.script.html' 126 | '3': 127 | 'name': 'punctuation.definition.tag.html' 128 | 'end': '(\\{%?/)((?i:script))(%?\\})(?:\\s*\\n)?' 129 | 'name': 'source.js.embedded.html' 130 | 'patterns': [ 131 | { 132 | 'begin': '(%?\\})' 133 | 'beginCaptures': 134 | '1': 135 | 'name': 'punctuation.definition.tag.html' 136 | 'end': '(?=\\{%?/(?i:script))' 137 | 'patterns': [ 138 | { 139 | 'include': 'source.js' 140 | } 141 | ] 142 | } 143 | ] 144 | } 145 | { 146 | 'include': 'source.html' 147 | } 148 | ] 149 | 'scopeName': 'source.smarty' 150 | --------------------------------------------------------------------------------