{ "name": "Clojure", "scopeName": "source.clojure", "patterns": [ { "include": "#comment" }, { "include": "#shebang-comment" }, { "include": "#quoted-sexp" }, { "include": "#sexp" }, { "include": "#keyfn" }, { "include": "#string" }, { "include": "#vector" }, { "include": "#set" }, { "include": "#map" }, { "include": "#regexp" }, { "include": "#var" }, { "include": "#constants" }, { "include": "#dynamic-variables" }, { "include": "#metadata" }, { "include": "#namespace-symbol" }, { "include": "#symbol" } ], "repository": { "comment": { "name": "comment.line.semicolon.clojure", "begin": "(?\u003c!\\\\);", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.clojure" } } }, "constants": { "patterns": [ { "name": "constant.language.nil.clojure", "match": "(nil)(?=(\\s|\\)|\\]|\\}))" }, { "name": "constant.language.boolean.clojure", "match": "(true|false)" }, { "name": "constant.numeric.ratio.clojure", "match": "(-?\\d+/\\d+)" }, { "name": "constant.numeric.arbitrary-radix.clojure", "match": "(-?\\d+[rR]\\w+)" }, { "name": "constant.numeric.hexadecimal.clojure", "match": "(-?0[xX][0-9a-fA-F]+)" }, { "name": "constant.numeric.octal.clojure", "match": "(-?0\\d+)" }, { "name": "constant.numeric.bigdecimal.clojure", "match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?M)" }, { "name": "constant.numeric.double.clojure", "match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?)" }, { "name": "constant.numeric.bigint.clojure", "match": "(-?\\d+N)" }, { "name": "constant.numeric.long.clojure", "match": "(-?\\d+)" }, { "include": "#keyword" } ] }, "dynamic-variables": { "name": "meta.symbol.dynamic.clojure", "match": "\\*[\\w\\.\\-\\_\\:\\+\\=\\\u003e\\\u003c\\!\\?\\d]+\\*" }, "keyfn": { "patterns": [ { "name": "storage.control.clojure", "match": "(?\u003c=(\\s|\\(|\\[|\\{))(if(-[-\\p{Ll}\\?]*)?|when(-[-\\p{Ll}]*)?|for(-[-\\p{Ll}]*)?|cond|do|let(-[-\\p{Ll}\\?]*)?|binding|loop|recur|fn|throw[\\p{Ll}\\-]*|try|catch|finally|([\\p{Ll}]*case))(?=(\\s|\\)|\\]|\\}))" }, { "name": "keyword.control.clojure", "match": "(?\u003c=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[\\p{Ll}\\-]*))(?=(\\s|\\)|\\]|\\}))" } ] }, "keyword": { "name": "constant.keyword.clojure", "match": "(?\u003c=(\\s|\\(|\\[|\\{)):[\\w\\#\\.\\-\\_\\:\\+\\=\\\u003e\\\u003c\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))" }, "map": { "name": "meta.map.clojure", "begin": "(\\{)", "end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "punctuation.section.map.begin.clojure" } }, "endCaptures": { "1": { "name": "punctuation.section.map.end.trailing.clojure" }, "2": { "name": "punctuation.section.map.end.clojure" } } }, "metadata": { "patterns": [ { "name": "meta.metadata.map.clojure", "begin": "(\\^\\{)", "end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "punctuation.section.metadata.map.begin.clojure" } }, "endCaptures": { "1": { "name": "punctuation.section.metadata.map.end.trailing.clojure" }, "2": { "name": "punctuation.section.metadata.map.end.clojure" } } }, { "name": "meta.metadata.simple.clojure", "begin": "(\\^)", "end": "(\\s)", "patterns": [ { "include": "#keyword" }, { "include": "$self" } ] } ] }, "namespace-symbol": { "patterns": [ { "match": "([\\p{L}\\.\\-\\_\\+\\=\\\u003e\\\u003c\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\\u003e\\\u003c\\!\\?\\*\\d]*)/", "captures": { "1": { "name": "meta.symbol.namespace.clojure" } } } ] }, "quoted-sexp": { "name": "meta.quoted-expression.clojure", "begin": "(['``]\\()", "end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "punctuation.section.expression.begin.clojure" } }, "endCaptures": { "1": { "name": "punctuation.section.expression.end.trailing.clojure" }, "2": { "name": "punctuation.section.expression.end.trailing.clojure" }, "3": { "name": "punctuation.section.expression.end.clojure" } } }, "regexp": { "name": "string.regexp.clojure", "begin": "#\"", "end": "\"", "patterns": [ { "include": "#regexp_escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.regexp.begin.clojure" } }, "endCaptures": { "0": { "name": "punctuation.definition.regexp.end.clojure" } } }, "regexp_escaped_char": { "name": "constant.character.escape.clojure", "match": "\\\\." }, "set": { "name": "meta.set.clojure", "begin": "(\\#\\{)", "end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "punctuation.section.set.begin.clojure" } }, "endCaptures": { "1": { "name": "punctuation.section.set.end.trailing.clojure" }, "2": { "name": "punctuation.section.set.end.clojure" } } }, "sexp": { "name": "meta.expression.clojure", "begin": "(\\()", "end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))", "patterns": [ { "name": "meta.definition.global.clojure", "begin": "(?\u003c=\\()(ns|declare|def[\\w\\d._:+=\u003e\u003c!?*-]*|[\\w._:+=\u003e\u003c!?*-][\\w\\d._:+=\u003e\u003c!?*-]*/def[\\w\\d._:+=\u003e\u003c!?*-]*)\\s+", "end": "(?=\\))", "patterns": [ { "include": "#metadata" }, { "include": "#dynamic-variables" }, { "name": "entity.global.clojure", "match": "([\\p{L}\\.\\-\\_\\+\\=\\\u003e\\\u003c\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\\u003e\\\u003c\\!\\?\\*\\d]*)" }, { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.control.clojure" } } }, { "include": "#keyfn" }, { "include": "#constants" }, { "include": "#vector" }, { "include": "#map" }, { "include": "#set" }, { "include": "#sexp" }, { "match": "(?\u003c=\\()(.+?)(?=\\s|\\))", "patterns": [ { "include": "$self" } ], "captures": { "1": { "name": "entity.name.function.clojure" } } }, { "include": "$self" } ], "beginCaptures": { "1": { "name": "punctuation.section.expression.begin.clojure" } }, "endCaptures": { "1": { "name": "punctuation.section.expression.end.trailing.clojure" }, "2": { "name": "punctuation.section.expression.end.trailing.clojure" }, "3": { "name": "punctuation.section.expression.end.clojure" } } }, "shebang-comment": { "name": "comment.line.shebang.clojure", "begin": "^(#!)", "end": "$", "beginCaptures": { "1": { "name": "punctuation.definition.comment.shebang.clojure" } } }, "string": { "name": "string.quoted.double.clojure", "begin": "(?\u003c!\\\\)(\")", "end": "(\")", "patterns": [ { "name": "constant.character.escape.clojure", "match": "\\\\." } ], "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.clojure" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.clojure" } } }, "symbol": { "patterns": [ { "name": "meta.symbol.clojure", "match": "([\\p{L}\\.\\-\\_\\+\\=\\\u003e\\\u003c\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\\u003e\\\u003c\\!\\?\\*\\d]*)" } ] }, "var": { "name": "meta.var.clojure", "match": "(?\u003c=(\\s|\\(|\\[|\\{)\\#)'[\\w\\.\\-\\_\\:\\+\\=\\\u003e\\\u003c\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))" }, "vector": { "name": "meta.vector.clojure", "begin": "(\\[)", "end": "(\\](?=[\\}\\]\\)\\s]*(?:;|$)))|(\\])", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "punctuation.section.vector.begin.clojure" } }, "endCaptures": { "1": { "name": "punctuation.section.vector.end.trailing.clojure" }, "2": { "name": "punctuation.section.vector.end.clojure" } } } } }