js.nanorc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ### all *js files ( e.g. Firefox user.js, prefs.js )
  2. ## Old version
  3. #syntax "jsfiles" "(\.|/|)js$"
  4. #color green "//.*$" start="\/\*" end="\*\/"
  5. #color blue "'(\\.|[^'])*'"
  6. #color red ""(\\.|[^\"])*""
  7. #color brightgreen "\<(true)\>"
  8. #color brightred "\<(false)\>" "http\:\/\/.*$"
  9. #color brightmagenta "[0-9](\\.|[^\"])*)"
  10. ## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting
  11. syntax "JavaScript" "\.(js)$"
  12. ## Default
  13. color white "^.+$"
  14. ## Decimal, cotal and hexadecimal numbers
  15. color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
  16. ## Floating point number with at least one digit before decimal point
  17. color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
  18. color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
  19. ## Keywords
  20. color green "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
  21. color green "\<(for|function|if|in|instanceof|new|null|return|switch)\>"
  22. color green "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>"
  23. ## Type specifiers
  24. color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
  25. color red "\<(Number|Object|RegExp|String)\>"
  26. color red "\<(true|false)\>"
  27. ## String
  28. color brightyellow "L?\"(\\"|[^"])*\""
  29. color brightyellow "L?'(\'|[^'])*'"
  30. ## Escapes
  31. color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
  32. ## Comments
  33. color brightblue start="/\*" end="\*/"
  34. color brightblue "//.*$"