summaryrefslogtreecommitdiff
path: root/doc/syntax/javascript.nanorc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/syntax/javascript.nanorc')
-rw-r--r--doc/syntax/javascript.nanorc19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/syntax/javascript.nanorc b/doc/syntax/javascript.nanorc
new file mode 100644
index 0000000..991f54b
--- /dev/null
+++ b/doc/syntax/javascript.nanorc
@@ -0,0 +1,19 @@
+## 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}'"
+
+# Strings.
+color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'"
+# Comments.
+color brightblue "//.*"
+color brightblue start="/\*" end="\*/"
+
+# Trailing whitespace.
+color ,green "[[:space:]]+$"