%YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html name: Clojure comment: 'Symbol pattern : [a-zA-Z+!\-_?0-9*~#@''`/.$=]' file_extensions: - clj scope: source.clojure contexts: main: - include: comment - include: function - include: function_multi_method - include: macro - include: namespace - include: sexpr comment: - match: (;;).*(;;)$\n? scope: comment.line.semicolon.double.banner.clojure captures: 1: punctuation.definition.comment.clojure - match: (;;).*$\n? scope: comment.line.semicolon.double.clojure captures: 1: punctuation.definition.comment.clojure - match: ^(;).*$\n? scope: comment.line.semicolon.start.clojure captures: 1: punctuation.definition.comment.clojure - match: (;).*$\n? scope: comment.line.semicolon.clojure captures: 1: punctuation.definition.comment.clojure all: - include: function - include: function_multi_method - include: lambda - include: macro - include: comment - include: expr - include: sexpr binding: - include: comment - include: metadata - match: '\[' scope: punctuation.definition.vector.begin.clojure push: - meta_scope: meta.structure.binding.vector.clojure - match: '(?=\])' pop: true - match: '(?<=\[)' comment: "TODO: merge with parameters ??" push: - meta_scope: meta.parameters.vector.clojure - match: '\]' scope: punctuation.definition.vector.end.clojure pop: true - include: comment - include: metadata - include: parameters_variable - match: \& scope: keyword.operator.varargs.clojure - match: '(:as)(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' scope: keyword.operator.symbolargs.clojure - include: parameters - include: parameters_map - include: all - include: binding_exp - match: '\{' scope: punctuation.definition.map.begin.clojure push: - meta_scope: meta.structure.binding.map.clojure - match: '(?=\])' pop: true - match: '(?<=\{)' comment: "TODO: merge with map ??" push: - meta_scope: meta.function.parameters.map.clojure - match: '\}' scope: punctuation.definition.map.end.clojure pop: true - include: comment - include: metadata - include: parameters_variable - match: '(:as|:or|:keys|:strs|:syms)(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' scope: keyword.operator.symbolargs.clojure - include: parameters - include: parameters_map - include: all - include: binding_exp - match: '(:let|:when|:while)(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' captures: 1: keyword.operator.symbolargs.clojure push: - meta_scope: meta.structure.binding.symbolargs.clojure - match: '(?=\])' pop: true - include: binding_exp - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' comment: symbol matching push: - meta_scope: meta.structure.binding.symbol.clojure - match: '(?=\])' pop: true - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - meta_scope: variable.parameter.clojure - match: '(?<=[a-zA-Z+!\-_?0-9*~#@''`/.$=])(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: keyword - include: operator - include: number - include: symbol - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - match: '(?=\])' pop: true - include: binding_exp - match: '[^\s]' push: - meta_scope: invalid.illegal.bindings.clojure - match: '[^\]]' pop: true binding_exp: - include: comment - include: metadata - include: operator_special - match: '(\(\)|{}|\[\]|#{})' captures: 1: constant.language.clojure push: - meta_scope: meta.structure.binding_exp.constant.language.clojure - match: '(?=\])' pop: true - include: binding - match: (?=#?\() push: - meta_scope: meta.structure.binding_exp.sexp.clojure - match: '(?=\])' pop: true - match: (?=#?\() push: - match: (?<=\)) pop: true - include: function - include: function_multi_method - include: lambda - include: macro - include: sexpr - include: binding - match: '\[' scope: punctuation.definition.vector.begin.clojure push: - meta_scope: meta.structure.binding_exp.vector.clojure - match: '(?=\])' pop: true - match: '(?<=\[)' comment: "TODO: merge with vector" push: - meta_scope: meta.expression.vector.clojure - match: '\]' scope: punctuation.definition.vector.end.clojure pop: true - include: all - include: binding - match: '\{' scope: punctuation.definition.map.begin.clojure push: - meta_scope: meta.structure.binding_exp.map.clojure - match: '(?=\])' pop: true - match: '(?<=\{)' comment: "TODO: merge with map" push: - meta_scope: meta.expression.map.clojure - match: "}" scope: punctuation.definition.map.end.clojure pop: true - include: all - include: binding - match: '(?=#\{)' push: - meta_scope: meta.structure.binding_exp.set.clojure - match: '(?=\])' pop: true - include: set - include: binding - match: (?=")|(?=\\)|(?=\:)|(?=\#") push: - meta_scope: meta.structure.binding_exp.string.clojure - match: '(?=\])' pop: true - include: string - include: binding - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' comment: symbol matching push: - meta_scope: meta.structure.binding_exp.symbol.clojure - match: '(?=\])' pop: true - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - match: '(?<=[a-zA-Z+!\-_?0-9*~#@''`/.$=])(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: keyword - include: operator - include: number - include: symbol - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - match: '(?=\])' pop: true - include: binding - match: '[^\s]' push: - meta_scope: invalid.illegal.bindings.clojure - match: '[^\]]' pop: true bindings_form: - match: '\[' comment: bindings followed by all push: - meta_scope: meta.structure.bindings.clojure - match: (?=\)) pop: true - match: '(?<=\[)' push: - match: '\]' pop: true - include: binding - match: '(?<=\])' push: - match: (?=\)) pop: true - include: all expr: - include: keyword - include: operator - include: string - include: vector - include: map - include: set - include: metadata - include: number - include: symbol function: - match: \(\s*(defn\-?)\s captures: 1: storage.type.function.type.clojure push: - meta_scope: meta.function.clojure - match: \) captures: 1: punctuation.terminator.function.clojure pop: true - include: comment - include: metadata - match: \s* - include: function_name - include: function_body_comment function_body: - match: '\(\s*(?=\[)' push: - meta_scope: meta.function.body.code.clojure - match: \) pop: true - include: parameters_body - match: '(?=\[)' push: - meta_scope: meta.function.body.clojure - match: (?=\)) pop: true - include: parameters_body function_body_comment: - match: '"' scope: string.quoted.double.begin.clojure push: - meta_scope: string.docstring.clojure - match: '"' scope: string.quoted.double.end.clojure pop: true - include: string_escape - match: '\{' scope: comment.punctuation.definition.metadata.begin.clojure push: - meta_scope: meta.metadata.map.clojure - match: '\}' scope: comment.punctuation.definition.metadata.end.clojure pop: true - include: metadata_patterns - include: function_body function_multi_method: - match: \(\s*(defmethod\-?)\s+ captures: 1: storage.type.function.type.clojure push: - meta_scope: meta.function.multi_method.clojure - match: \) pop: true - include: comment - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - match: (?=\)) pop: true - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - meta_scope: meta.function.multi_method.name.clojure - match: '(?<=[a-zA-Z+!\-_?0-9*~#@''`/.$=])(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: function_name - match: '(?<=[a-zA-Z+!\-_?0-9*~#@''`/.$=])(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - match: (?=\)) pop: true - include: comment - include: metadata - include: operator_special - match: '(\(\)|{}|\[\]|#{})' captures: 1: constant.language.clojure push: - meta_scope: meta.structure.multi_method_exp.constant.language.clojure - match: (?=\)) pop: true - include: parameters_body - match: (?=#?\() push: - meta_scope: meta.structure.multi_method_exp.sexp.clojure - match: (?=\)) pop: true - match: (?=#?\() push: - match: (?<=\)) pop: true - include: function - include: function_multi_method - include: lambda - include: macro - include: sexpr - include: parameters_body - match: '\[' scope: punctuation.definition.vector.begin.clojure push: - meta_scope: meta.structure.multi_method_exp.vector.clojure - match: (?=\)) pop: true - match: '(?<=\[)' comment: "TODO: merge with vector" push: - meta_scope: meta.expression.vector.clojure - match: '\]' scope: punctuation.definition.vector.end.clojure pop: true - include: all - match: '(?<=\])\s*' push: - match: (?=\)) pop: true - include: parameters_body - match: '\{' scope: punctuation.definition.map.begin.clojure push: - meta_scope: meta.structure.multi_method_exp.map.clojure - match: (?=\)) pop: true - match: '(?<=\{)' comment: "TODO: merge with map" push: - meta_scope: meta.expression.map.clojure - match: "}" scope: punctuation.definition.map.end.clojure pop: true - include: all - include: parameters_body - match: '(?=#\{)' push: - meta_scope: meta.structure.multi_method_exp.set.clojure - match: (?=\)) pop: true - include: set - include: parameters_body - match: (?=")|(?=\\)|(?=\:)|(?=\#") push: - meta_scope: meta.structure.multi_method_exp.string.clojure - match: (?=\)) pop: true - include: string - include: parameters_body - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' comment: symbol matching push: - meta_scope: meta.structure.multi_method_exp.symbol.clojure - match: (?=\)) pop: true - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - match: '(?<=[a-zA-Z+!\-_?0-9*~#@''`/.$=])(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: symbol_java_inherited_class - include: keyword - include: operator - include: number - include: symbol - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - match: (?=\)) pop: true - include: parameters_body function_name: - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' comment: symbol matching push: - meta_scope: entity.name.function.clojure - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: keyword - include: operator - match: '-(?=[a-zA-Z+!\-_?*~#@''`/.$=])' scope: keyword.operator.prefix.genclass.clojure push: - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: symbol - include: symbol genclass_parameters: - include: gencommon_parameters - match: (:extends)\s+ captures: 1: support.other.keyword.genclass.clojure push: - meta_scope: meta.other.genclass.extends.clojure - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: symbol_java_inherited_class - match: '(:implements)\s+(\[)' captures: 1: support.other.keyword.genclass.clojure push: - meta_scope: meta.other.genclass.implements.clojure - match: '\]' pop: true - include: symbol_java_inherited_class - include: all - match: '(:constructors)\s+(\{)' captures: 1: support.other.keyword.genclass.clojure push: - meta_scope: meta.other.genclass.constructors.clojure - match: '\}' pop: true - match: '\[' push: - meta_scope: meta.other.genclass.constructor.signature.clojure - match: '\]' pop: true - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' comment: "TODO: make a rule java Class (storage)" push: - meta_scope: storage.type.java.clojure - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: symbol - include: all - include: all - match: '(:exposes)\s+(\{)' captures: 1: support.other.keyword.genclass.clojure push: - meta_scope: meta.other.genclass.exposes.clojure - match: '\}' pop: true - match: '\{' push: - meta_scope: meta.other.genclass.exposes.get_set.clojure - match: '\}' pop: true - match: ":(get|set)" scope: support.other.keyword.genclass.clojure - include: all - include: all - match: ':(init|main|factory|state|prefix|load-impl-ns|implements|constructors|exposes|impl-ns|exposes-methods|methods)(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' scope: support.other.keyword.genclass.clojure - include: all gencommon_parameters: - include: comment - match: '(:name)\s+(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' captures: 1: support.other.keyword.genclass.clojure push: - meta_scope: meta.other.genclass.name.clojure - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' push: - meta_scope: entity.name.namespace.clojure - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: symbol - match: '(:methods)\s+(\[)' captures: 1: support.other.keyword.genclass.clojure push: - meta_scope: meta.other.genclass.methods.clojure - match: '\]' pop: true - match: '\[' push: - meta_scope: meta.other.genclass.method.signature.clojure - match: '\]' pop: true - match: '\[' push: - meta_scope: meta.other.genclass.method.args.signature.clojure - match: '\]' pop: true - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=])' comment: "TODO: make a rule java Class (storage)" push: - meta_scope: storage.type.java.clojure - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: symbol - include: all - match: '(?=[a-zA-Z+!\-_?0-9*~#@''`/.$=]+\s*])' push: - meta_scope: storage.type.java.genclass.return_type.clojure - match: .|$ pop: true - include: symbol - include: all - include: all geninterface_parameters: - include: gencommon_parameters - match: '(:extends)\s+(\[)' captures: 1: support.other.keyword.genclass.clojure push: - meta_scope: meta.other.genclass.implements.clojure - match: '\]' pop: true - include: symbol_java_inherited_class - include: all keyword: - match: '(?|\.\.|amap|and|areduce|assert|binding|comment|cond|definline|(def[a-z\-]*)|defmatch|defmethod|defmulti|defn|defn-|defonce|defstruct|delay|doc|doseq|dosync|dotimes|doto|fn|for|if-let|lazy-cons|let|locking|loop|memfn|ns|or|prefer-method|proxy-super|proxy|refer-clojure|remove-method|sync|time|when-first|when-let|when-not|when|while|with-in-str|with-local-vars|with-open|with-out-str|with-precision|memoize)\b(?![*+!_?\-])' scope: support.function.match.clojure - match: '(?|\>=|-\>)(?![a-zA-Z0-9*+!_?\-])' scope: keyword.operator.clojure - match: '(? error ? push: - meta_scope: variable.parameter.clojure - match: '(?![a-zA-Z+!\-_?0-9*~#@''`/.$=])' pop: true - include: keyword - include: operator - include: number - include: symbol set: - match: "#{" scope: punctuation.definition.set.begin.clojure push: - meta_scope: meta.expression.set.clojure - match: "}" scope: punctuation.definition.set.end.clojure pop: true - include: all sexpr: - match: \((?!\)) push: - meta_scope: meta.sexpr.clojure - match: (?