-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathCoffeeScript Literate.sublime-syntax
More file actions
102 lines (89 loc) · 3.21 KB
/
CoffeeScript Literate.sublime-syntax
File metadata and controls
102 lines (89 loc) · 3.21 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
name: CoffeeScript (Literate)
scope: source.litcoffee
version: 2
extends: Packages/Markdown/Markdown.sublime-syntax
file_extensions:
- litcoffee
- litcoffee.erb
- coffee.md
contexts:
markdown:
- meta_prepend: true
- meta_scope: text.html.markdown.litcoffee
- include: coffee-indented-code-blocks
list-block-content:
- meta_prepend: true
- include: coffee-indented-code-blocks
coffee-indented-code-blocks:
- match: '{{indented_code_block}}'
scope: meta.embedded.litcoffee source.coffee.embedded.markdown
embed: scope:source.coffee
embed_scope: meta.embedded.litcoffee source.coffee.embedded.markdown
escape: ^(?=\s*$)
###[ FENCED CODE BLOCKS (NEW STYLE) ]###########################################
fenced-code-block-body:
# requires: https://github.com/sublimehq/Packages/pull/4430
- meta_prepend: true
- match: |-
(?xi)
[ \t]*
(coffee(?:script)?|cjsx|cson|iced)
(?=[ \t\n;:])
captures:
1: constant.other.language-name.markdown
push:
- fenced-code-block-coffee-content
- fenced-code-block-coffee-infostring
fenced-code-block-coffee-infostring:
- meta_include_prototype: false
- meta_scope: meta.code-fence.definition.begin.markdown-gfm
- meta_content_scope: comment.line.infostring.markdown
- match: \s*$\n?
scope: meta.fold.code-fence.begin.markdown
pop: 1
- match: \{
scope: punctuation.definition.attributes.begin.markdown
push: fenced-code-block-coffee-infostring-attributes
fenced-code-block-coffee-infostring-attributes:
- meta_scope: meta.attributes.markdown
- include: tag-attributes
fenced-code-block-coffee-content:
- meta_include_prototype: false
- match: ^
embed: scope:source.coffee
embed_scope:
meta.code-fence.body.markdown-gfm
markup.raw.code-fence.coffee.markdown-gfm
source.coffee
escape: (?!)
###[ FENCED CODE BLOCKS (OLD STYLE) ]###########################################
fenced-syntaxes:
# required until ST4202
- meta_append: true
- match: |-
(?x)
[ \t]* # leading whitespace
( (`)``+(?![^`]*`) | (~)~~+ ) # punctuation
((?i:coffee(?:script)?|cjsx|cson|iced)) # language identifier
(?: (?: \s+ | (?=[:;]) ) (\S.*?) )? # remaining infostring
(\s*$\n?) # fold marker
captures:
0: meta.code-fence.definition.begin.markdown-gfm
1: punctuation.definition.raw.code-fence.begin.markdown
4: constant.other.language-name.markdown
5: comment.line.infostring.markdown
6: meta.fold.code-fence.begin.markdown
embed: scope:source.coffee
embed_scope: markup.raw.code-fence.markdown-gfm source.coffee
escape: |-
(?x)
^[ \t]* # leading whitespace
( \1 (?:(?:\2)*|(?:\3)*) ) # punctuation
(\s*$\n?) # fold marker
escape_captures:
0: meta.code-fence.definition.end.markdown-gfm
1: punctuation.definition.raw.code-fence.end.markdown
2: meta.fold.code-fence.end.markdown