aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntax_rules/javascript.syntax
blob: a10045d74bbee12ad3debb7fdf37e5e9aeb6551a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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