View raw

1 { 2 "scopeName": "source.ocaml.ocamldoc", 3 "name": "OCamldoc", 4 "fileTypes": ["mld"], 5 "patterns": [{ "include": "#markup" }], 6 "repository": { 7 "markup": { 8 "patterns": [ 9 { 10 "comment": "ocamldoc documentation tag @raise", 11 "match": "(@raises?)[[:space:]]+([^[:space:]]+)", 12 "captures": { 13 "1": { "name": "keyword.doc-tag.ocamldoc" }, 14 "2": { 15 "name": "markup.inline.raw.ocamldoc source.embedded.ocamldoc constant.language.capital-identifier.ocaml" 16 } 17 } 18 }, 19 { 20 "comment": "ocamldoc documentation tag @param", 21 "match": "(@param)[[:space:]]+([^[:space:]]+)", 22 "captures": { 23 "1": { "name": "keyword.doc-tag.ocamldoc" }, 24 "2": { 25 "name": "markup.inline.raw.ocamldoc source.embedded.ocamldoc" 26 } 27 } 28 }, 29 { 30 "comment": "ocamldoc documentation tag @see", 31 "match": "(@see)[[:space:]]+(<.*?>|\".*?\"|'.*?')", 32 "captures": { 33 "1": { "name": "keyword.doc-tag.ocamldoc" }, 34 "2": { 35 "name": "markup.underline.link.ocamldoc meta.link.ocamldoc" 36 } 37 } 38 }, 39 { 40 "comment": "ocamldoc documentation tag", 41 "name": "keyword.doc-tag.ocamldoc", 42 "match": "@[[:lower:]]+" 43 }, 44 { 45 "comment": "embedded ocaml source", 46 "begin": "(?<!\\\\)\\[", 47 "end": "(?<!\\\\)\\]", 48 "name": "markup.inline.raw.ocamldoc", 49 "contentName": "source.embedded.ocamldoc", 50 "patterns": [{ "include": "source.ocaml" }] 51 }, 52 { 53 "comment": "embedded preformatted ocaml source", 54 "begin": "(?<!\\\\)\\{(@ocaml([[:space:]].*?)?)?\\[", 55 "end": "(?<!\\\\)\\]\\}", 56 "name": "markup.inline.raw.ocamldoc", 57 "contentName": "source.embedded.ocamldoc", 58 "patterns": [{ "include": "source.ocaml" }] 59 }, 60 { 61 "comment": "embedded other language source", 62 "begin": "(?<!\\\\)\\{@.+?\\[", 63 "end": "(?<!\\\\)\\]\\}", 64 "name": "markup.inline.raw.odoc", 65 "contentName": "source.embedded.odoc" 66 }, 67 { 68 "comment": "cross-reference", 69 "begin": "(?<!\\\\)\\{!((modules?|modtype|module-type|class|classtype|class-type|val|value|type|exception|exn|attribute|method|section|const|recfield|field|extension|extension-decl|instance-variable|label|page):)?", 70 "end": "(?<!\\\\)\\}", 71 "name": "markup.inline.raw.ocamldoc", 72 "contentName": "source.embedded.ocamldoc", 73 "patterns": [{ "include": "source.ocaml" }] 74 }, 75 { 76 "comment": "cross-reference with alt text", 77 "begin": "(?<!\\\\)\\{(\\{!((module|modtype|module-type|class|classtype|class-type|val|value|type|exception|exn|attribute|method|section|const|recfield|field|extension|extension-decl|instance-variable|label|page):)?)", 78 "end": "(\\}).*?(?<!\\\\)\\}", 79 "name": "markup.underline.link.ocamldoc meta.link.ocamldoc", 80 "contentName": "markup.inline.raw.ocamldoc source.embedded.ocamldoc", 81 "patterns": [{ "include": "source.ocaml" }], 82 "beginCaptures": { 83 "1": { "name": "markup.inline.raw.ocamldoc" } 84 }, 85 "endCaptures": { 86 "1": { "name": "markup.inline.raw.ocamldoc" } 87 } 88 }, 89 { 90 "comment": "ocamldoc heading tag", 91 "begin": "(?<!\\\\){[[:digit:]]+(:[^[:space:]]*)?[[:space:]]", 92 "end": "(?<!\\\\)}", 93 "name": "markup.heading.ocamldoc", 94 "patterns": [{ "include": "#markup" }], 95 "beginCaptures": { 96 "1": { "name": "meta.link.label.ocamldoc" } 97 } 98 }, 99 { 100 "comment": "ocamldoc bold", 101 "begin": "(?<!\\\\){b[[:space:]]", 102 "end": "(?<!\\\\)}", 103 "name": "markup.bold.ocamldoc", 104 "patterns": [{ "include": "#markup" }] 105 }, 106 { 107 "comment": "ocamldoc italic/emph", 108 "begin": "(?<!\\\\){(i|e)[[:space:]]", 109 "end": "(?<!\\\\)}", 110 "name": "markup.italic.ocamldoc", 111 "patterns": [{ "include": "#markup" }] 112 }, 113 { 114 "comment": "ocamldoc verbatim", 115 "begin": "(?<!\\\\){v[[:space:]]", 116 "end": "\\bv}", 117 "name": "markup.inline.raw.ocamldoc" 118 }, 119 { 120 "comment": "ocamldoc exponent/index", 121 "begin": "(?<!\\\\){(\\^|\\_)[[:space:]]", 122 "end": "(?<!\\\\)}", 123 "name": "markup.exponent.ocamldoc", 124 "patterns": [{ "include": "#markup" }] 125 }, 126 { 127 "comment": "odoc inline math", 128 "begin": "(?<!\\\\){m[[:space:]]", 129 "end": "(?<!\\\\)\\}", 130 "name": "support.class.math.odoc markup.math.inline.odoc meta.math.inline.odoc", 131 "patterns": [{ "include": "#braces" }] 132 }, 133 { 134 "comment": "odoc math block", 135 "begin": "(?<!\\\\){math[[:space:]]", 136 "end": "(?<!\\\\)\\}", 137 "name": "support.class.math.odoc markup.math.block.odoc meta.math.block.odoc", 138 "patterns": [{ "include": "#braces" }] 139 }, 140 { 141 "comment": "ocamldoc simple lists", 142 "match": "^[[:space:]]*(\\-|\\+)", 143 "name": "punctuation.definition.list.begin.markdown.ocamldoc" 144 }, 145 { 146 "comment": "ocamldoc lists", 147 "begin": "((?<!\\\\){(ul|ol)[[:space:]])", 148 "end": "((?<!\\\\)})", 149 "beginCaptures": { 150 "1": { 151 "name": "punctuation.definition.list.begin.markdown.ocamldoc" 152 } 153 }, 154 "endCaptures": { 155 "1": { 156 "name": "punctuation.definition.list.begin.markdown.ocamldoc" 157 } 158 }, 159 "patterns": [{ "include": "#lists" }] 160 }, 161 { 162 "comment": "ocamldoc tables", 163 "begin": "((?<!\\\\){table[[:space:]])", 164 "end": "((?<!\\\\)})", 165 "beginCaptures": { 166 "1": { 167 "name": "punctuation.definition.list.begin.markdown.table.ocamldoc" 168 } 169 }, 170 "endCaptures": { 171 "1": { 172 "name": "punctuation.definition.list.begin.markdown.table.ocamldoc" 173 } 174 }, 175 "patterns": [{ "include": "#table" }] 176 }, 177 { 178 "comment": "ocamldoc light tables", 179 "begin": "((?<!\\\\){t[[:space:]])", 180 "end": "((?<!\\\\)})", 181 "beginCaptures": { 182 "1": { 183 "name": "punctuation.definition.list.begin.markdown.table.light.ocamldoc" 184 } 185 }, 186 "endCaptures": { 187 "1": { 188 "name": "punctuation.definition.list.begin.markdown.table.light.ocamldoc" 189 } 190 }, 191 "patterns": [{ "include": "#lighttable" }] 192 }, 193 { 194 "comment": "ocamldoc links with alt-text", 195 "begin": "(?<!\\\\){({:.*?})", 196 "beginCaptures": { 197 "1": { "name": "string.other.link.title.markdown.ocamldoc" } 198 }, 199 "end": "(?<!\\\\)\\}", 200 "patterns": [{ "include": "#markup" }], 201 "name": "markup.underline.link.ocamldoc meta.link.ocamldoc" 202 }, 203 { 204 "comment": "ocamldoc links", 205 "match": "(?<!\\\\)({:.*?})", 206 "captures": { 207 "1": { "name": "string.other.link.title.markdown.ocamldoc" } 208 } 209 }, 210 { 211 "comment": "ocamldoc latex", 212 "begin": "(?<!\\\\){\\%([[:space:]]|latex:)", 213 "end": "\\%}", 214 "name": "markup.inline.raw.ocamldoc", 215 "patterns": [{ "include": "text.tex.latex" }] 216 }, 217 { 218 "comment": "ocamldoc html", 219 "begin": "(?<!\\\\){\\%html:", 220 "end": "\\%}", 221 "name": "markup.inline.raw.ocamldoc", 222 "patterns": [{ "include": "text.html.derivative" }] 223 } 224 ] 225 }, 226 "lists": { 227 "patterns": [ 228 { 229 "comment": "ocamldoc list element", 230 "begin": "((?<!\\\\){(\\-|li)[[:space:]])", 231 "end": "((?<!\\\\)})", 232 "beginCaptures": { 233 "1": { 234 "name": "punctuation.definition.list.begin.markdown.ocamldoc" 235 } 236 }, 237 "endCaptures": { 238 "1": { 239 "name": "punctuation.definition.list.begin.markdown.ocamldoc" 240 } 241 }, 242 "patterns": [{ "include": "#markup" }] 243 } 244 ] 245 }, 246 "table": { 247 "patterns": [ 248 { 249 "comment": "ocamldoc table row", 250 "begin": "((?<!\\\\){tr[[:space:]])", 251 "end": "((?<!\\\\)})", 252 "beginCaptures": { 253 "1": { 254 "name": "punctuation.definition.list.begin.markdown.table.row.ocamldoc" 255 } 256 }, 257 "endCaptures": { 258 "1": { 259 "name": "punctuation.definition.list.begin.markdown.table.row.ocamldoc" 260 } 261 }, 262 "patterns": [{ "include": "#tablerow" }] 263 } 264 ] 265 }, 266 "tablerow": { 267 "patterns": [ 268 { 269 "comment": "ocamldoc table cell", 270 "begin": "((?<!\\\\){td[[:space:]])", 271 "end": "((?<!\\\\)})", 272 "beginCaptures": { 273 "1": { 274 "name": "punctuation.definition.list.begin.markdown.table.cell.ocamldoc" 275 } 276 }, 277 "endCaptures": { 278 "1": { 279 "name": "punctuation.definition.list.begin.markdown.table.cell.ocamldoc" 280 } 281 }, 282 "patterns": [{ "include": "#markup" }] 283 }, 284 { 285 "comment": "ocamldoc table header cell", 286 "begin": "((?<!\\\\){th[[:space:]])", 287 "end": "((?<!\\\\)})", 288 "contentName": "markup.bold.tableheader.ocamldoc", 289 "beginCaptures": { 290 "1": { 291 "name": "punctuation.definition.list.begin.markdown.tableheader.ocamldoc" 292 } 293 }, 294 "endCaptures": { 295 "1": { 296 "name": "punctuation.definition.list.begin.markdown.tableheader.ocamldoc" 297 } 298 }, 299 "patterns": [{ "include": "#markup" }] 300 } 301 ] 302 }, 303 "lighttable": { 304 "patterns": [ 305 { "include": "#markup" }, 306 { 307 "comment": "table characters", 308 "match": "\\||(\\-\\-\\-+)|(:\\-\\-\\-+:)|(:\\-\\-+)|(\\-\\-+:)", 309 "name": "punctuation.definition.list.begin.markdown.tableheader.tablechars.ocamldoc" 310 } 311 ] 312 }, 313 "braces": { 314 "patterns": [ 315 { 316 "begin": "(?<!\\\\){", 317 "end": "(?<!\\\\)\\}", 318 "patterns": [{ "include": "#braces" }] 319 } 320 ] 321 } 322 } 323 } 324