]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/clojure.yaml
Ignore tool files
[micro.git] / runtime / syntax / clojure.yaml
1 filetype: clojure
2
3 detect:
4     filename: "\\.(clj[sc]?|edn)$"
5
6 rules:
7
8     # Constants
9     - constant.bool: "\\b(true|false)\\b"
10     - constant.macro: "\\b(nil)\\b"
11       # Valid numbers
12     - constant.number: "[\\-]?[0-9]+?\\b"
13     - constant.number: "0x[0-9][A-Fa-f]+?\\b"
14     - constant.number: "[\\-]?(3[0-6]|2[0-9]|1[0-9]|[2-9])r[0-9A-Z]+?\\b"
15       # Invalid numbers
16     - error: "[\\-]?([4-9][0-9]|3[7-9]|1|0)r[0-9A-Z]+?\\b"
17
18       # Symbols
19     - symbol.operator: "[=>+\\-*/'?]"
20
21       # Types/casting
22     - type: "\\b(byte|short|(big)?int(eger)?|long|float|num|bigdec|rationalize)\\b"
23
24       # String highlighting
25     - constant.string:
26         start: "\""
27         end: "\""
28         skip: "\\\\."
29         rules:
30             - constant.specialChar: "(\\\\u[0-9A-fa-f]{4,4}|\\\\newline|\\\\space|\\\\tab|\\\\formfeed|\\\\backspace|\\\\return|\\\\.)"
31
32       # Comments
33     - comment:
34         start: ";"
35         end: "$"
36         rules:
37             - todo: "(TODO|XXX|FIXME):?"
38