File tree 4 files changed +90
-54
lines changed
4 files changed +90
-54
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ private rule test2: tag2 tag3 tag4 tag5 {
17
17
filesize > 1MB and all of them
18
18
}
19
19
20
- private rule test3 : tag4 tag5 {
20
+ rule test3 : tag4 tag5 {
21
21
strings :
22
22
$ hello = " hello world "
23
23
$ test = " test "
24
24
$ = " test2 "
25
25
$ = " test3 "
26
26
condition :
27
- filesize > 2MB and any of them
27
+ filesize > 2MB and any of them and none of ( $ h * ) and none of ( $ t * )
28
28
}
Original file line number Diff line number Diff line change 1
1
id = " yara"
2
2
name = " Yara"
3
- version = " 0.0.1 "
3
+ version = " 0.0.2 "
4
4
schema_version = 1
5
5
authors = [
" egibs <[email protected] >" ]
6
6
description = " Yara syntax highlighting for Zed."
7
7
repository = " https://github.com/egibs/yara-zed"
8
8
9
9
[grammars .yara ]
10
10
repository = " https://github.com/egibs/tree-sitter-yara.git"
11
- commit = " a8058d3fcffa5d61aa66185c976e9f6efbea2a8d "
11
+ commit = " eb3ede203275c38000177f72ec0f9965312806ef "
Original file line number Diff line number Diff line change
1
+ ; Comments
2
+ (comment) @comment
3
+
1
4
; Keywords
2
5
[
3
- "rule"
4
6
"global"
5
- "private"
6
7
"import"
7
- "include"
8
+ "private"
9
+ ] @constant.builtin
10
+
11
+ [
12
+ "rule"
13
+ ] @function
14
+
15
+ [
16
+ "meta"
8
17
"strings"
9
18
"condition"
10
- "meta"
11
- ] @keyword
19
+ ] @property
12
20
13
- ; Keywords (condition)
21
+ ; Operators
14
22
[
15
- "and"
16
- "or"
17
- "not"
18
23
"matches"
19
24
"contains"
20
25
"icontains"
23
28
"istartswith"
24
29
"endswith"
25
30
"iendswith"
26
- "for"
31
+ "and"
32
+ "or"
33
+ "not"
34
+ "=="
35
+ "!="
36
+ "<"
37
+ ">"
38
+ ">="
39
+ "<="
27
40
"of"
28
- "in "
41
+ "for "
29
42
"all"
30
43
"any"
31
44
"none"
32
- "them"
33
- "filesize"
34
- "entrypoint"
35
- ] @keyword.operator
45
+ "in"
46
+ ] @string.special
36
47
37
48
; String modifiers
38
49
[
39
- "ascii"
40
50
"wide"
51
+ "ascii"
41
52
"nocase"
42
53
"fullword"
43
54
"xor"
44
55
"base64"
45
56
"base64wide"
46
57
] @keyword.modifier
47
58
48
- ; Rule names
49
- (rule_definition
50
- name: (identifier) @module )
51
-
52
- ; Tags
53
- ((tag) @tag )
54
-
55
- ; Meta definitions
56
- (meta_definition
57
- key: (identifier) @property )
58
-
59
- ; String identifiers
60
- (string_identifier
61
- (identifier)? @string.special )
62
-
63
- ; Constants
64
- (boolean_literal) @constant.builtin
65
-
59
+ ; Numbers and sizes
66
60
(integer_literal) @constant.numeric
67
61
(size_unit) @constant.numeric
68
62
69
63
; Strings
70
64
(double_quoted_string) @string
71
65
(single_quoted_string) @string
72
66
(escape_sequence) @string.escape
67
+ (text_string) @text.literal
73
68
74
69
; Hex strings
75
70
(hex_string) @string.special
76
71
(hex_byte) @constant.numeric
77
72
(hex_wildcard) @constant.builtin
73
+ (hex_jump) @constant.numeric
78
74
79
- ; Regex strings
75
+ ; Regular expressions
80
76
(regex_string) @string.regexp
81
77
(pattern) @string.regexp
82
78
83
- ; Operators
79
+ ; Boolean literals
84
80
[
85
- ">"
86
- "<"
87
- "=="
88
- "<="
89
- ">="
90
- "!="
91
- "+"
92
- "-"
81
+ "true"
82
+ "false"
83
+ ] @constant.boolean
84
+
85
+ ; Keywords and special identifiers
86
+ [
87
+ "them"
88
+ "all"
89
+ "any"
90
+ "none"
91
+ ] @keyword.operator
92
+
93
+
94
+ ; String identifiers
95
+ "$" @string.special.symbol
96
+ (identifier) @string
97
+ (string_identifier) @string.special.symbol
98
+
99
+ ; Built-ins
100
+ [
101
+ (filesize_keyword)
102
+ (entrypoint_keyword)
103
+ ] @constant.builtin
104
+
105
+ ; Tags
106
+ (tag_list
107
+ [(identifier) (tag)] @tag )
108
+
109
+ ; Punctuation and delimiters
110
+ [
111
+ "="
112
+ ":"
113
+ "{"
114
+ "}"
115
+ "["
116
+ "]"
117
+ "("
118
+ ")"
119
+ "#"
120
+ "@"
121
+ ".."
122
+ "|"
123
+ ","
124
+ "!"
125
+ "/"
126
+ "\""
127
+ "'"
93
128
"*"
94
- "\\"
95
- "%"
96
- ] @operator
129
+ ] @string.special.symbol
97
130
98
- [":" "=" "{" "}" "(" ")" "[" "]" "$" "#" "@" "!" ".." "|" ","] @punctuation.delimiter
131
+ ; Rule names
132
+ (rule_definition
133
+ name: (identifier) @string.special )
99
134
100
- ; Comments
101
- (comment) @comment
135
+ ; Meta definitions
136
+ (meta_definition
137
+ key: (identifier) @string.special )
You can’t perform that action at this time.
0 commit comments