@@ -0,0 +1,306 @@
3+# http://www.sublimetext.com/docs/syntax.html
11+ - match: ^(\s*)(ruby):$
13+ 2: constant.language.name.ruby.filter.slim
15+ - meta_scope: text.ruby.filter.slim
16+ - match: ^(?!(\1\s)|\s*$)
18+ - include: scope:source.ruby
19+ - match: ^(\s*)(javascript):$
21+ 2: constant.language.name.javascript.filter.slim
23+ - meta_scope: source.js.filter.slim
24+ - match: ^(?!(\1\s)|\s*$)
26+ - include: scope:source.js
29+ 1: storage.frontmatter.slim
31+ - meta_scope: source.yaml.meta.slim
34+ 1: storage.frontmatter.slim
36+ - include: scope:source.yaml
37+ - match: ^(\s*)(coffee):$
39+ 2: constant.language.name.coffeescript.filter.slim
41+ - meta_scope: text.coffeescript.filter.slim
42+ - match: ^(?!(\1\s)|\s*$)
44+ - include: scope:source.coffee
45+ - match: ^(\s*)(markdown):$
47+ 2: constant.language.name.markdown.filter.slim
49+ - meta_scope: text.markdown.filter.slim
50+ - match: ^(?!(\1\s)|\s*$)
52+ - include: scope:text.html.markdown
53+ - match: ^(\s*)(css):$
55+ 2: constant.language.name.css.filter.slim
57+ - meta_scope: text.css.filter.slim
58+ - match: ^(?!(\1\s)|\s*$)
60+ - include: scope:source.css
61+ - match: ^(\s*)(sass):$
63+ 2: constant.language.name.sass.filter.slim
65+ - meta_scope: text.sass.filter.slim
66+ - match: ^(?!(\1\s)|\s*$)
68+ - include: scope:source.sass
69+ - match: ^(\s*)(scss):$
71+ 2: constant.language.name.scss.filter.slim
73+ - meta_scope: text.scss.filter.slim
74+ - match: ^(?!(\1\s)|\s*$)
76+ - include: scope:source.scss
77+ - match: ^(\s*)(less):$
79+ 2: constant.language.name.less.filter.slim
81+ - meta_scope: text.less.filter.slim
82+ - match: ^(?!(\1\s)|\s*$)
84+ - include: scope:source.less
85+ - match: ^(\s*)(erb):$
87+ 2: constant.language.name.erb.filter.slim
89+ - meta_scope: text.erb.filter.slim
90+ - match: ^(?!(\1\s)|\s*$)
92+ - include: scope:source.erb
93+ - match: ^(! )($|\s.*)
94+ scope: meta.prolog.slim
96+ 1: punctuation.definition.prolog.slim
97+ - match: ^(\s*)(/)\s*.*$
99+ 2: comment.line.slash.slim
101+ - meta_scope: comment.block.slim
102+ - match: ^(?!(\1\s)|\s*$)
114+ - include: tag-attribute
115+ - include: embedded-ruby
116+ - match: ^(\s*)(\||')\s*
117+ comment: Verbatim text (can include HTML tags and copied lines)
119+ - match: ^(?!(\1\s)|\s*$)
121+ - include: scope:text.html.basic
122+ - include: embedded-ruby
123+ - match: '^\s*(\.|#|[-a-zA-Z0-9]+)([\w-]+)?'
124+ comment: '1 - dot OR hash OR any combination of word, number; 2 - OPTIONAL any combination of word, number, dash or underscore (following a . or'
126+ 1: entity.name.tag.slim
127+ 2: entity.other.attribute-name.event.slim
129+ - meta_scope: meta.tag
130+ - match: '$|(?!\.|#|:|-|~|/|\}|\]|\*|\s?[\*\{])'
132+ 1: entity.name.tag.slim
133+ 2: entity.other.attribute-name.event.slim
135+ - match: '(:[\w\d]+)+'
138+ - meta_scope: entity.name.tag.slim
141+ - match: '(:\s)(\.|#|[a-zA-Z0-9]+)([\w-]+)?'
142+ comment: Inline HTML / 1 - colon; 2 - dot OR hash OR any combination of word, number; 3 - OPTIONAL any combination of word, number, dash or underscore (following a . or
144+ 1: punctuation.definition.tag.end.slim
145+ 2: entity.name.tag.slim
146+ 3: entity.other.attribute-name.event.slim
148+ - match: '$|(?!\.|#|=|-|~|/|\}|\]|\*|\s?[\*\{])'
150+ 1: punctuation.definition.tag.end.slim
151+ 2: entity.name.tag.slim
152+ 3: entity.other.attribute-name.event.slim
154+ - include: root-class-id-tag
155+ - include: tag-attribute
156+ - match: '(\*\{)(?=.*\}|.*\|\s*$)'
157+ comment: Splat attributes
159+ 1: punctuation.section.embedded.ruby
161+ - meta_scope: source.ruby.embedded.slim
162+ - match: '(\})|$|^(?!.*\|\s*$)'
164+ 1: punctuation.section.embedded.ruby
166+ - include: embedded-ruby
167+ - include: root-class-id-tag
170+ scope: punctuation.terminator.tag.slim
174+ - match: ^\s*(?=\||')
178+ - include: embedded-ruby
179+ - include: scope:text.html.basic
180+ - match: '(?=<[\w\d\:]+)'
181+ comment: Inline and root-level HTML tags
185+ - include: scope:text.html.basic
187+ - match: '([\\,])\s*\n'
189+ 1: punctuation.separator.continuation.slim
193+ - meta_scope: source.ruby.embedded.slim
194+ - match: \)(?=( \w|$))
196+ - include: scope:source.ruby.rails
200+ - meta_scope: source.ruby.embedded.slim
201+ - match: '\](?=( \w|$))'
203+ - include: scope:source.ruby.rails
207+ - meta_scope: source.ruby.embedded.slim
208+ - match: '\}(?=( \w|$))'
210+ - include: scope:source.ruby.rails
212+ - match: '(?<!\\)#\{{1,2}'
214+ 0: punctuation.section.embedded.ruby
216+ - meta_scope: source.ruby.embedded.html
219+ 0: punctuation.section.embedded.ruby
221+ - include: scope:source.ruby.rails
223+ - match: '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)'
224+ scope: constant.character.entity.html
226+ 1: punctuation.definition.entity.html
227+ 3: punctuation.definition.entity.html
229+ scope: invalid.illegal.bad-ampersand.html
233+ - meta_scope: source.ruby.embedded.html
237+ - match: '(\.|#)([\w\d\-]+)'
239+ 1: punctuation.separator.key-value.html
240+ 2: entity.other.attribute-name.html
242+ - match: (==|=)(<>|><|<'|'<|<|>)?|-
243+ comment: Hack to thwart Sublime's Ruby highlighter. It thinks do without a variable continues the next line (this can be muted with a / at the end of the line). For things like yields, do is unnecessary without an argument, so this hack will suffice
245+ - meta_scope: meta.line.ruby.slim
246+ - meta_content_scope: source.ruby.embedded.slim
247+ - match: (do\s*\n$)|(?<!\\|,|,\n|\\\n)$
249+ 1: keyword.control.start-block.ruby
252+ comment: Hack to let ruby comments work in this context properly
253+ scope: comment.line.number-sign.ruby
254+ - include: continuation
255+ - include: scope:source.ruby.rails
256+ string-double-quoted:
259+ 0: punctuation.definition.string.begin.html
261+ - meta_scope: string.quoted.double.html
262+ - meta_content_scope: meta.toc-list.id.html
265+ 0: punctuation.definition.string.end.html
267+ - include: embedded-ruby
269+ string-single-quoted:
272+ 0: punctuation.definition.string.begin.html
274+ - meta_scope: string.quoted.single.html
275+ - meta_content_scope: meta.toc-list.id.html
278+ 0: punctuation.definition.string.end.html
280+ - include: embedded-ruby
283+ - match: '([\w.#_-]+)(=)(?!\s)(true|false|nil)?(\s*\(|\{)?'
285+ 1: entity.other.attribute-name.event.slim
286+ 2: punctuation.separator.key-value.html
287+ 3: constant.language.slim
289+ - meta_scope: meta.attribute-with-value.slim
292+ 1: entity.other.attribute-name.event.slim
293+ 2: punctuation.separator.key-value.html
294+ 3: constant.language.slim
296+ - include: tag-stuff
297+ - include: string-double-quoted
298+ - include: string-single-quoted
300+ - include: tag-attribute
301+ - include: interpolated-ruby
302+ - include: delimited-ruby-a
303+ - include: delimited-ruby-b
304+ - include: delimited-ruby-c
306+ - include: embedded-ruby