@@ -0,0 +1,283 @@
3+# http://www.sublimetext.com/docs/3/syntax.html
6+ A very early hack. Mostly ripped from other syntaxes.
7+ Only the very basic stuff is working.
12+scope: text.html.asciidoc
15+ - include: heading_inline
16+ - include: heading-block
17+ - include: heading-blockattr
20+ - meta_scope: comment.block.passthrough.macro.doubledollar.asciidoc
23+ - match: \+\+\+(?!\+)
25+ - meta_scope: comment.block.passthrough.macro.tripeplus.asciidoc
26+ - match: \+\+\+(?!\+)
29+ scope: comment.line.double-slash.asciidoc
32+ (?= ([/+-.*_=]{4,})\s*$
35+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
38+ - meta_scope: meta.block-level.asciidoc
44+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
47+ - include: block_quote
49+ - include: heading_inline
50+ - include: heading-block
52+ - match: '^[ ]{0,3}([*+-])(?=\s)'
54+ 1: punctuation.definition.list_item.asciidoc
56+ - meta_scope: markup.list.unnumbered.asciidoc
59+ 1: punctuation.definition.list_item.asciidoc
61+ - include: list-paragraph
62+ - match: '^[ ]{0,3}[0-9]+(\.)(?=\s)'
64+ 1: punctuation.definition.list_item.asciidoc
66+ - meta_scope: markup.list.numbered.asciidoc
69+ 1: punctuation.definition.list_item.asciidoc
71+ - include: list-paragraph
72+ - match: '^([/+-.*_=]){4,}\s*$'
74+ - meta_scope: comment.block.asciidoc
75+ - match: '^\1{4,}\s*$'
77+ - match: '^([/+.]){4,}\s*$'
78+ comment: asciidoc formatting is disabled inside certain blocks.
80+ - meta_scope: meta.disable-asciidoc
81+ - match: '^[/+.]{4,}\s*$'
83+ - match: '^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+)'
85+ - meta_scope: meta.paragraph.asciidoc
86+ - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n'
89+ - include: scope:text.html.basic
90+ - match: '^(={3,})(?=[ \t]*$)'
91+ scope: markup.heading.0.asciidoc
93+ 1: punctuation.definition.heading.asciidoc
94+ - match: '^(-{3,})(?=[ \t]*$)'
95+ scope: markup.heading.1.asciidoc
97+ 1: punctuation.definition.heading.asciidoc
98+ - match: '^(~{3,})(?=[ \t]*$)'
99+ scope: markup.heading.2.asciidoc
101+ 1: punctuation.definition.heading.asciidoc
102+ - match: '^(\^{3,})(?=[ \t]*$)'
103+ scope: markup.heading.3.asciidoc
105+ 1: punctuation.definition.heading.asciidoc
106+ - match: '^(\+{3,})(?=[ \t]*$)'
107+ scope: markup.heading.4.asciidoc
109+ 1: punctuation.definition.heading.asciidoc
111+ - match: '^:[-_. A-Za-z0-9]+:\s*(.*)\s*$'
112+ scope: variable.other
113+ attribute-reference:
114+ - match: "{[-_. A-Za-z0-9]+}"
115+ scope: variable.other
116+ attribute-reference-predefined:
117+ - match: "{(?i:amp|asciidoc-dir|asciidoc-file|asciidoc-version|author|authored|authorinitials|backend-docbook|backend-xhtml11|backend-html4|docbook-article|xhtml11-article|html4-article|docbook-book|xhtml11-book|html4-book|docbook-manpage|xhtml11-manpage|html4-manpage|backend|backslash|basebackend|brvbar|date|docdate|doctime|docname|docfile|docdir|doctitle|doctype-article|doctype-book|doctype-manpage|doctype|email|empty|encoding|filetype|firstname|gt|id|indir|infile|lastname|level|listindex|localdate|localtime|lt|manname|manpurpose|mantitle|manvolnum|middlename|nbsp|outdir|outfile|reftext|revision|sectnum|showcomments|title|two_colons|two_semicolons|user-dir|verbose)}"
118+ scope: support.variable
120+ - match: '^([/+-.*_=]){4,}\s*$'
122+ - meta_scope: comment.block.asciidoc
123+ - match: '^\1{4,}\s*$'
126+ - match: '\G([ ]{4}|\t).*$\n?'
127+ scope: markup.raw.block.asciidoc
129+ - match: '<(?![a-z/?\$!])'
131+ asciidoc will convert this for us. We match it so that the
132+ HTML grammar will not mark it up as invalid.
133+ scope: meta.other.valid-bracket.asciidoc
134+ character-replacements:
135+ - match: \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<=
136+ scope: constant.character.asciidoc
138+ - match: '\\[-`*_#+.!(){}\[\]\\>:]'
139+ scope: constant.character.escape.asciidoc
141+ - match: '(?m)^(\S+)$([=-~^+])+\s*$'
142+ scope: markup.heading.asciidoc
144+ 1: punctuation.definition.heading.asciidoc
147+ scope: markup.heading.asciidoc
149+ 1: punctuation.definition.heading.asciidoc
151+ - match: '^\[\[?(\w.*)\]$'
152+ scope: markup.heading.asciidoc
154+ 1: punctuation.definition.heading.asciidoc
156+ - match: '\G(={1,6})(?!=)\s*(?=\S)'
158+ 1: punctuation.definition.heading.asciidoc
160+ - meta_scope: markup.heading.asciidoc
161+ - meta_content_scope: entity.name.section.asciidoc
162+ - match: \s*(=*)$\n?
164+ 1: punctuation.definition.heading.asciidoc
168+ - include: line-break
169+ - include: line-page-break
170+ - include: line-ruler
172+ - include: passthrough-macro-trippleplus-inline
173+ - include: passthrough-macro-doubledollar-inline
174+ - include: character-replacements
177+ - include: text-quote-single
178+ - include: text-quote-double
179+ - include: text-quote-other
180+ - include: text-bold-unconstrained
181+ - include: text-italic-unconstrained
182+ - include: text-monospace-unconstrained
183+ - include: text-unquoted-unconstrained
184+ - include: text-bold
185+ - include: text-italic
186+ - include: text-monospace
187+ - include: text-unquoted
188+ - include: attribute-entry
189+ - include: attribute-reference-predefined
190+ - include: attribute-reference
192+ - match: (?<=\S)\s+\+$
193+ scope: constant.character.escape.asciidoc
196+ scope: constant.character.escape.asciidoc
199+ scope: constant.character.escape.asciidoc
201+ - match: \G\s+(?=\S)
203+ - meta_scope: meta.paragraph.list.asciidoc
207+ passthrough-macro-doubledollar-inline:
208+ - match: '(?:\[.*\])?\$\$(?!\$).+\$\$(?!\$)'
209+ scope: comment.block.passthrough.asciidoc
210+ passthrough-macro-trippleplus-inline:
211+ - match: '(?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+)'
212+ scope: comment.block.passthrough.asciidoc
214+ - match: '(`+)(?:[^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
215+ scope: markup.raw.inline.asciidoc
217+ 1: punctuation.definition.raw.asciidoc
218+ 2: punctuation.definition.raw.asciidoc
220+ - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?'
221+ scope: meta.separator.asciidoc
223+ - match: (?<!\w)(\*)(?=\S)
225+ 1: punctuation.definition.bold.asciidoc
227+ - meta_scope: markup.bold.asciidoc
228+ - match: (?<=\S)(\1)(?!\w)
230+ 1: punctuation.definition.bold.asciidoc
232+ text-bold-unconstrained:
233+ - match: (\*\*)(?=\S)
235+ 1: punctuation.definition.bold.asciidoc
237+ - meta_scope: markup.bold.asciidoc
238+ - match: (?<=\S)(\1)
240+ 1: punctuation.definition.bold.asciidoc
243+ - match: (?<!\w)('|_)(?=\S)
245+ 1: punctuation.definition.italic.asciidoc
247+ - meta_scope: markup.italic.asciidoc
248+ - match: (?<=\S)(\1)((?!\1)|(?=\1\1))(?!\w)
250+ 1: punctuation.definition.italic.asciidoc
252+ text-italic-unconstrained:
255+ 1: punctuation.definition.italic.asciidoc
257+ - meta_scope: markup.italic.asciidoc
258+ - match: (?<=\S)(\1)
260+ 1: punctuation.definition.italic.asciidoc
263+ - match: '(?<!\w)([\+`])[^\+]*(\1)(?!\w)'
264+ scope: string.interpolated.asciidoc
265+ text-monospace-unconstrained:
266+ - match: (\+\+).*(\1)
267+ scope: string.interpolated.asciidoc
269+ - match: '(?<!\w)(?:\[.*\])?``(?!`).*''''(?!'')(?!\w)'
270+ scope: string.quoted.double.asciidoc
272+ - match: '(?<!\w)(?:\[.*\])?([~^]).*(\1)(?!\w)'
273+ scope: string.quoted.single.asciidoc
275+ - match: '(?<!\w)(?:\[.*\])?`(?!`).*''(?!'')(?!\w)'
276+ comment: "TODO: Sub- and Superscript are really unconstrained"
277+ scope: string.quoted.single.asciidoc
279+ - match: (?<!\w)(#).*(\1)(?!\w)
280+ scope: string.unquoted.asciidoc
281+ text-unquoted-unconstrained:
283+ scope: string.unquoted.asciidoc