nanorc/js.nanorc

53 lines
1.6 KiB
Plaintext
Raw Normal View History

2012-06-13 20:12:05 +02:00
### all *js files ( e.g. Firefox user.js, prefs.js )
## Old version
#syntax "JavaScript" "(\.|/|)js$"
2012-06-13 20:12:05 +02:00
#color green "//.*$" start="\/\*" end="\*\/"
#color blue "'(\\.|[^'])*'"
#color red ""(\\.|[^\"])*""
2018-08-09 10:09:19 +02:00
#color green "\<(true)\>"
#color red "\<(false)\>" "http\:\/\/.*$"
#color magenta "[0-9](\\.|[^\"])*)"
2012-06-13 20:12:05 +02:00
## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting
syntax "JavaScript" "\.(js)$"
## Default
color white "^.+$"
## Decimal, cotal and hexadecimal numbers
color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
## Floating point number with at least one digit before decimal point
color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
## Keywords
color green "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
color green "\<(for|function|if|in|instanceof|new|null|return|switch)\>"
color green "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>"
color green "\<(import|as|from|export)\>"
color green "\<const|let|class|extends|of|get|set|await|async|yield)\>"
2012-06-13 20:12:05 +02:00
## Type specifiers
color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
color red "\<(WeakMap|Map|WeakSet|Set|Symbol|Promise)\>"
2012-06-13 20:12:05 +02:00
color red "\<(Number|Object|RegExp|String)\>"
color red "\<(true|false)\>"
## String
2018-08-09 10:09:19 +02:00
color yellow "L?\"(\\"|[^"])*\""
color yellow "L?'(\'|[^'])*'"
2012-06-13 20:12:05 +02:00
2016-12-06 22:04:38 +01:00
## Trailing spaces
color ,green "[[:space:]]+$"
2012-06-13 20:12:05 +02:00
## Escapes
color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
## Comments
2018-08-09 10:09:19 +02:00
color blue start="/\*" end="\*/"
color blue "//.*$"