]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/r.yaml
Ignore tool files
[micro.git] / runtime / syntax / r.yaml
1 filetype: r
2
3 detect:
4     filename: "\\.(r|R)$"
5
6 rules:
7
8     - statement: "\\b(library|require|break|else|for|function|if|ifelse|in|next|names|switch|repeat|print|try|tryCatch|isTRUE|return|while)\\b"
9     - constant: "\\b(T|TRUE|F|FALSE|NULL|Inf|NaN|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\\b"
10     - constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)"
11     - symbol.operator: "([.:;,+*|=!\\%]|<|>|/|-|&|\\^|\\$)" 
12
13     - comment:
14         start: "#"
15         end: "$"
16         rules:
17             - todo: "(TODO|XXX|FIXME):?"
18
19     - constant.string:
20         start: "\""
21         end: "\""
22         skip: "\\\\."
23         rules:
24             - constant.specialChar: "\\\\."
25
26     - constant.string:
27         start: "'"
28         end: "'"
29         skip: "\\\\."
30         rules:
31             - constant.specialChar: "\\\\."
32