84
|
1 ### all *js files ( e.g. Firefox user.js, prefs.js )
|
|
2
|
|
3 ## Old version
|
|
4
|
|
5 #syntax "JavaScript" "(\.|/|)js$"
|
|
6 #color green "//.*$" start="\/\*" end="\*\/"
|
|
7 #color blue "'(\\.|[^'])*'"
|
|
8 #color red ""(\\.|[^\"])*""
|
|
9 #color brightgreen "\<(true)\>"
|
|
10 #color brightred "\<(false)\>" "http\:\/\/.*$"
|
|
11 #color brightmagenta "[0-9](\\.|[^\"])*)"
|
|
12
|
|
13 ## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting
|
|
14
|
|
15 syntax "JavaScript" "\.(js)$"
|
|
16
|
|
17 ## Default
|
|
18 color white "^.+$"
|
|
19
|
|
20 ## Decimal, cotal and hexadecimal numbers
|
|
21 color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
|
|
22
|
|
23 ## Floating point number with at least one digit before decimal point
|
|
24 color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
|
25 color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
|
26
|
|
27 ## Keywords
|
|
28 color green "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
|
|
29 color green "\<(for|function|if|in|instanceof|new|null|return|switch)\>"
|
|
30 color green "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>"
|
|
31 color green "\<(import|as|from|export)\>"
|
|
32 color green "\<const|let|class|extends|of|get|set|await|async|yield)\>"
|
|
33
|
|
34 ## Type specifiers
|
|
35 color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
|
|
36 color red "\<(WeakMap|Map|WeakSet|Set|Symbol|Promise)\>"
|
|
37 color red "\<(Number|Object|RegExp|String)\>"
|
|
38 color red "\<(true|false)\>"
|
|
39
|
|
40 ## String
|
|
41 color brightyellow "L?\"(\\"|[^"])*\""
|
|
42 color brightyellow "L?'(\'|[^'])*'"
|
|
43
|
|
44 ## Trailing spaces
|
|
45 color ,green "[[:space:]]+$"
|
|
46
|
|
47 ## Escapes
|
|
48 color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
|
|
49
|
|
50 ## Comments
|
|
51 color brightblue start="/\*" end="\*/"
|
|
52 color brightblue "//.*$"
|