aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2017-06-15 16:58:05 -0400
committerZackaryWelch <welch.zackary@gmail.com>2017-06-15 16:58:05 -0400
commit68c6331479f3c347fd6928071edbf11967947a95 (patch)
treeaa5ecf4c7e3bf5d933e4b156054956fec0a2cdc4 /src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-68c6331479f3c347fd6928071edbf11967947a95.tar.gz
lumina-68c6331479f3c347fd6928071edbf11967947a95.tar.bz2
lumina-68c6331479f3c347fd6928071edbf11967947a95.zip
HTML and Javascript syntax highlighting
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax43
1 files changed, 43 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax
new file mode 100644
index 00000000..a10045d7
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax
@@ -0,0 +1,43 @@
+# Syntax support file for the Lumina Text Editor
+# ===================================
+# JSON language support rules
+# Written by Ken Moore <ken@ixsystems.com>
+# Released under the 2-clause BSD license
+# ===================================
+
+{
+ "meta": {
+ "name": "Javascript",
+ "file_suffix": ["js"]
+ },
+ "format": {
+ "line_wrap": false,
+ "highlight_whitespace_eol" : false
+ },
+ "rules": [{
+ "name": "keywords",
+ "words": ["export","function", "import", "from", "let", "if", "return", "for", "while"],
+ "foreground": "colors/keyword"
+ },
+ {
+ "name": "single-line comment",
+ "regex": "//[^\n]*",
+ "foreground": "colors/comment"
+ },
+ {
+ "name": "numbers",
+ "regex": "\\b([0-9]+[\\.]?[0-9]?)+\\b",
+ "foreground": "colors/altkeyword"
+ },
+ {
+ "name": "function names",
+ "regex": "\\b[A-Za-z0-9_]+(?=\\()|(?:\\.)[a-z]+",
+ "foreground": "colors/function"
+ },
+ {
+ "name" : "text",
+ "regex": "\"[^\"\\\\]*(\\\\(.|\\n)[^\"\\\\]*)*\"|'[^'\\\\]*(\\\\(.|\\n)[^'\\\\]*)*'",
+ "foreground" : "colors/text"
+ }
+ ]
+}
bgstack15