View raw

1 { 2 "name": "dune", 3 "scopeName": "source.dune", 4 "fileTypes": [ 5 "dune", 6 "jbuild" 7 ], 8 "patterns": [ 9 { 10 "include": "#comments" 11 }, 12 { 13 "name": "meta.stanza.dune", 14 "begin": "\\([[:space:]]*(library|rule|executable|executables|rule|ocamllex|ocamlyacc|menhir|install|alias|copy_files|copy_files#|jbuild_version|include)[[:space:]]", 15 "end": "\\)", 16 "beginCaptures": { 17 "1": { 18 "name": "meta.class.stanza.dune" 19 } 20 }, 21 "patterns": [ 22 { 23 "include": "$self" 24 } 25 ] 26 }, 27 { 28 "name": "meta.stanza.library.field.dune", 29 "begin": "\\([[:space:]]*(name|public_name|synopsis|install_c_headers|ppx_runtime_libraries|c_flags|cxx_flags|c_names|cxx_names|library_flags|c_library_flags|virtual_deps|modes|kind|wrapped|optional|self_build_stubs_archive|no_dynlink|ppx\\.driver)[[:space:]]", 30 "end": "\\)", 31 "beginCaptures": { 32 "1": { 33 "name": "keyword.other.dune" 34 } 35 }, 36 "patterns": [ 37 { 38 "include": "$self" 39 } 40 ] 41 }, 42 { 43 "name": "meta.stanza.rule.dune", 44 "begin": "\\([[:space:]]*(targets|deps|locks|loc|mode|action)[[:space:]]", 45 "beginCaptures": { 46 "1": { 47 "name": "keyword.other.dune" 48 } 49 }, 50 "end": "\\)", 51 "patterns": [ 52 { 53 "include": "$self" 54 } 55 ] 56 }, 57 { 58 "name": "meta.mono-sexp.dune", 59 "match": "\\([[:space:]]*(fallback|optional)[[:space:]]*\\)", 60 "captures": { 61 "1": { 62 "name": "keyword.other.dune" 63 } 64 } 65 }, 66 { 67 "name": "meta.stanza.rule.action.dune", 68 "begin": "\\([[:space:]]*(run|chdir|setenv|with-stdout-to|with-stderr-to|with-outputs-to|ignore-stdout|ignore-stderr|ignore-outputs|progn|echo|cat|copy|copy#|system|bash|write-file|diff|diff\\?)[[:space:]]", 69 "end": "\\)", 70 "beginCaptures": { 71 "1": { 72 "name": "entity.name.function.action.dune" 73 } 74 }, 75 "patterns": [ 76 { 77 "include": "$self" 78 } 79 ] 80 }, 81 { 82 "name": "meta.stanza.install.dune", 83 "begin": "\\([[:space:]]*(section)[[:space:]]", 84 "end": "\\)", 85 "beginCaptures": { 86 "1": { 87 "name": "keyword.other.dune" 88 } 89 }, 90 "patterns": [ 91 { 92 "name": "constant.language.rule.mode.dune", 93 "match": "\\b(lib|libexec|bin|sbin|toplevel|share|share_root|etc|doc|stublibs|man|misc)\\b" 94 } 95 ] 96 }, 97 { 98 "name": "meta.stanza.install.dune", 99 "begin": "\\([[:space:]]*(files)[[:space:]]", 100 "end": "\\)", 101 "beginCaptures": { 102 "1": { 103 "name": "keyword.other.dune" 104 } 105 }, 106 "patterns": [ 107 { 108 "include": "$self" 109 } 110 ] 111 }, 112 { 113 "name": "meta.library.kind.dune", 114 "begin": "\\([[:space:]]*(normal|ppx_deriver|ppx_rewriter)[[:space:]]", 115 "end": "\\)", 116 "beginCaptures": { 117 "1": { 118 "name": "constant.language.rule.mode.dune" 119 } 120 } 121 }, 122 { 123 "name": "meta.stanza.executables.dune", 124 "begin": "\\([[:space:]]*(name|link_executables|link_flags|modes)[[:space:]]", 125 "end": "\\)", 126 "beginCaptures": { 127 "1": { 128 "name": "keyword.other.dune" 129 } 130 }, 131 "patterns": [ 132 { 133 "include": "$self" 134 } 135 ] 136 }, 137 { 138 "name": "meta.stanza.lib-or-exec.buildable.dune", 139 "begin": "\\([[:space:]]*(preprocess|preprocessor_deps|lint|modules|modules_without_implementation|libraries|flags|ocamlc_flags|ocamlopt_flags|js_of_ocaml|allow_overlapping_dependencies|per_module)[[:space:]]", 140 "end": "\\)", 141 "beginCaptures": { 142 "1": { 143 "name": "keyword.other.dune" 144 } 145 }, 146 "patterns": [ 147 { 148 "include": "$self" 149 } 150 ] 151 }, 152 { 153 "name": "meta.stanza.lib-or-exec.buildable.preprocess.dune", 154 "begin": "\\([[:space:]]*(no_preprocessing|action|pps)[[:space:]]", 155 "end": "\\)", 156 "beginCaptures": { 157 "1": { 158 "name": "keyword.other.dune" 159 } 160 }, 161 "patterns": [ 162 { 163 "include": "$self" 164 } 165 ] 166 }, 167 { 168 "name": "meta.stanza.lib-or-exec.buildable.preprocess_deps.dune", 169 "begin": "\\([[:space:]]*(file|alias|alias_rec|glob_files|files_recursively_in)[[:space:]]", 170 "end": "\\)", 171 "beginCaptures": { 172 "1": { 173 "name": "keyword.other.dune" 174 } 175 }, 176 "patterns": [ 177 { 178 "include": "$self" 179 } 180 ] 181 }, 182 { 183 "name": "meta.stanza.lib-or-exec.buildable.libraries.dune", 184 "begin": "\\([[:space:]]*(select)[[:space:]]", 185 "end": "\\)", 186 "beginCaptures": { 187 "1": { 188 "name": "keyword.other.dune" 189 } 190 }, 191 "patterns": [ 192 { 193 "include": "$self" 194 } 195 ] 196 }, 197 { 198 "name": "constant.numeric.dune", 199 "match": "\\b\\d+\\b" 200 }, 201 { 202 "name": "constant.language.dune", 203 "match": "(true|false)" 204 }, 205 { 206 "name": "keyword.other.dune", 207 "match": "[[:space:]](as|from|->)[[:space:]]" 208 }, 209 { 210 "name": "keyword.other.dune", 211 "match": "(\\!)" 212 }, 213 { 214 "name": "constant.language.flag.dune", 215 "match": "(:\\w+)\\b" 216 }, 217 { 218 "name": "constant.language.rule.mode.dune", 219 "match": "\\b(standard|fallback|promote|promote-until-then)\\b" 220 }, 221 { 222 "include": "#string" 223 }, 224 { 225 "include": "#variable" 226 }, 227 { 228 "include": "#list" 229 }, 230 { 231 "include": "#atom" 232 } 233 ], 234 "repository": { 235 "comments": { 236 "patterns": [ 237 { 238 "name": "comment.block.dune", 239 "begin": "#\\|", 240 "beginCaptures": { 241 "0": { 242 "name": "punctuation.definition.comment.begin.dune" 243 } 244 }, 245 "end": "\\|#", 246 "endCaptures": { 247 "0": { 248 "name": "punctuation.definition.comment.end.dune" 249 } 250 }, 251 "patterns": [ 252 { 253 "include": "#comments" 254 } 255 ] 256 }, 257 { 258 "name": "comment.sexp.dune", 259 "begin": "#;[[:space:]]*\\(", 260 "end": "\\)", 261 "patterns": [ 262 { 263 "include": "#comment-inner" 264 } 265 ] 266 }, 267 { 268 "name": "comment.line.dune", 269 "match": ";.*$" 270 } 271 ] 272 }, 273 "comment-inner": { 274 "patterns": [ 275 { 276 "name": "comment.sexp.inner.dune", 277 "begin": "\\(", 278 "end": "\\)", 279 "patterns": [ 280 { 281 "include": "#comment-inner" 282 } 283 ] 284 } 285 ] 286 }, 287 "string": { 288 "patterns": [ 289 { 290 "name": "string.quoted.double.dune", 291 "begin": "(?=[^\\\\])(\")", 292 "beginCaptures": { 293 "1": { 294 "name": "punctuation.definition.string.begin.dune" 295 } 296 }, 297 "end": "(\")", 298 "endCaptures": { 299 "1": { 300 "name": "punctuation.definition.string.end.dune" 301 } 302 }, 303 "patterns": [ 304 { 305 "name": "constant.character.string.escape.dune", 306 "match": "\\\\\"" 307 }, 308 { 309 "include": "#variable" 310 } 311 ] 312 } 313 ] 314 }, 315 "variable": { 316 "patterns": [ 317 { 318 "name": "variable.other.dune", 319 "match": "\\${[^}]*}" 320 } 321 ] 322 }, 323 "list": { 324 "patterns": [ 325 { 326 "name": "meta.list.dune", 327 "begin": "(\\()", 328 "end": "(\\))", 329 "captures": { 330 "1": { 331 "name": "entity.tag.list.parenthesis.dune" 332 } 333 }, 334 "comment": "ok, for this one, I didn't know what to choose", 335 "patterns": [ 336 { 337 "include": "$self" 338 } 339 ] 340 } 341 ] 342 }, 343 "atom": { 344 "patterns": [ 345 { 346 "name": "meta.atom.dune", 347 "match": "\\b[^[[:space:]]]+\\b" 348 } 349 ] 350 } 351 } 352 }