2014-03-24 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/gentoo.nanorc - Match more files, add a trailing
whitespace check, and EAPI=5 updates. Patch by Mike Frysinger.
+ * doc/syntax/javascript.nanorc - New file, by Mike Frysinger.
2014-03-23 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a
--- /dev/null
+## Here is an example for Javascript.
+##
+syntax "javascript" "\.js$"
+color brightred "\<[A-Z_][0-9A-Z_]+\>"
+color green "\<(const|function|let|this|typeof|var|void)\>"
+color brightyellow "\<(for|if|while|with|do|else|case|default|switch)\>"
+color brightyellow "\<(export|try|throw|catch|new|delete)\>"
+color magenta "\<(continue|break|return|yield)\>"
+color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
+
+## String highlighting. You will in general want your comments and
+## strings to come last, because syntax highlighting rules will be
+## applied in the order they are read in.
+color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'"
+
+## Comment highlighting
+color brightblue "//.*"
+color brightblue start="/\*" end="\*/"
+
+## Trailing whitespace
+color ,green "[[:space:]]+$"