]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/javascript.yaml
Add support for skipping and remove need for lookbehind
[micro.git] / runtime / syntax / javascript.yaml
1 filetype: javascript
2
3 detect:
4     filename: "\\.js$"
5
6 rules:
7     - constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
8     - constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
9     - constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
10     - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
11     - statement: "\\b(break|case|catch|continue|default|delete|do|else|finally)\\b"
12     - statement: "\\b(for|function|get|if|in|instanceof|new|return|set|switch)\\b"
13     - statement: "\\b(switch|this|throw|try|typeof|var|void|while|with)\\b"
14     - constant: "\\b(null|undefined|NaN)\\b"
15     - constant: "\\b(true|false)\\b"
16     - type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b"
17     - type: "\\b(Number|Object|RegExp|String)\\b"
18     - statement: "[-+/*=<>!~%?:&|]"
19     - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
20     - constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
21
22     - constant.string:
23         start: "\""
24         end: "\""
25         rules:
26             - constant.specialChar: "\\\\."
27
28     - constant.string:
29         start: "'"
30         end: "'"
31         rules:
32             - constant.specialChar: "\\\\."
33
34     - comment:
35         start: "//"
36         end: "$"
37         rules: []
38
39     - comment:
40         start: "/\\*"
41         end: "\\*/"
42         rules: []
43