-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRuby Haml.sublime-syntax
81 lines (81 loc) · 2.38 KB
/
Ruby Haml.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
%YAML 1.2
---
name: Ruby Haml
file_extensions:
- haml
- sass
scope: text.haml
contexts:
main:
- match: ^(!!!)($|\s.*)
scope: meta.prolog.haml
captures:
1: punctuation.definition.prolog.haml
- match: ^ *(/)\s*\S.*$\n?
scope: comment.line.slash.haml
captures:
1: punctuation.section.comment.haml
- match: ^( *)(/)\s*$
captures:
2: punctuation.section.comment.haml
push:
- meta_scope: comment.block.haml
- match: ^(?!\1 )
pop: true
- include: "Ruby Haml.sublime-syntax"
- match: '^\s*(?:((%)([\w:]+))|(?=\.|#))'
captures:
1: meta.tag.haml
2: punctuation.definition.tag.haml
3: entity.name.tag.haml
push:
- match: '$|(?!\.|#|\{|\[|=|-|~|/)'
pop: true
- match: '\.[\w-]+'
scope: entity.name.tag.class.haml
- match: '#[\w-]+'
scope: entity.name.tag.id.haml
- match: '\{(?=.*\}|.*\|\s*$)'
push:
- meta_scope: meta.section.attributes.haml
- match: '\}|$|^(?!.*\|\s*$)'
pop: true
- include: "Ruby on Rails.sublime-syntax"
- include: continuation
- match: '\[(?=.*\]|.*\|\s*$)'
push:
- meta_scope: meta.section.object.haml
- match: '\]|$|^(?!.*\|\s*$)'
pop: true
- include: "Ruby on Rails.sublime-syntax"
- include: continuation
- include: rubyline
- match: /
scope: punctuation.terminator.tag.haml
- match: ^\s*(\\.)
captures:
1: meta.escape.haml
- match: ^\s*(?==|-|~)
push:
- match: $
pop: true
- include: rubyline
continuation:
- match: (\|)\s*\n
captures:
1: punctuation.separator.continuation.haml
rubyline:
- match: "=|-|~"
push:
- meta_scope: meta.line.ruby.haml
- meta_content_scope: source.ruby.embedded.haml
- match: '((do|\{)( \|[^|]+\|)?)$|$|^(?!.*\|\s*$)'
captures:
1: source.ruby.embedded.html
2: keyword.control.ruby.start-block
pop: true
- match: "#.*$"
comment: Hack to let ruby comments work in this context properly
scope: comment.line.number-sign.ruby
- include: Packages/Rails/Ruby on Rails.sublime-syntax
- include: continuation