|
8 | 8 | { "include": "#definitions" }, |
9 | 9 | { "include": "#keywords" }, |
10 | 10 | { "include": "#names" }, |
11 | | - { "include": "#strings" }, |
12 | | - { "include": "#characters" }, |
13 | | - { "include": "#numbers" }, |
| 11 | + { "include": "#literals" }, |
14 | 12 | { "include": "#holes" } |
15 | 13 | ], |
16 | 14 | "repository": { |
|
112 | 110 | "name": "keyword.control" |
113 | 111 | }] |
114 | 112 | }, |
115 | | - "names": { |
| 113 | + "literals": { |
116 | 114 | "patterns": [{ |
117 | 115 | "match": "\\b(true|false)\\b", |
118 | | - "name": "constant.language" |
| 116 | + "name": "constant.language.boolean.effekt" |
119 | 117 | }, { |
120 | | - "match": "\\b([a-z][a-zA-Z0-9_]*)\\b[\\s]*[({\\[]", |
121 | | - "captures": { |
122 | | - "1": { "name": "entity.name.function" } |
123 | | - } |
| 118 | + "match": "\\b([0-9]+\\.[0-9]+)\\b", |
| 119 | + "name": "constant.numeric.float.effekt" |
124 | 120 | }, { |
125 | | - "match": "\\b[a-z][a-zA-Z0-9_]*\\b", |
126 | | - "name": "variable" |
| 121 | + "match": "\\b([0-9]+)\\b", |
| 122 | + "name": "constant.numeric.integer.effekt" |
127 | 123 | }, { |
128 | | - "match": "\\b[A-Z][a-zA-Z0-9_]*\\b", |
129 | | - "name": "entity.name.type" |
| 124 | + "include": "#characters" |
| 125 | + }, { |
| 126 | + "include": "#strings" |
| 127 | + }] |
| 128 | + }, |
| 129 | + "characters": { |
| 130 | + "name": "string.quoted.single.effekt", |
| 131 | + "begin": "'", |
| 132 | + "end": "'", |
| 133 | + "patterns": [{ |
| 134 | + "name": "constant.character.escape.effekt", |
| 135 | + "match": "\\\\((u[0-9a-fA-F]{4})|.)" |
130 | 136 | }] |
131 | 137 | }, |
132 | 138 | "strings": { |
133 | 139 | "patterns": [{ |
| 140 | + "name": "string.quoted.triple.effekt", |
134 | 141 | "begin": "\"\"\"", |
135 | 142 | "end": "\"\"\"", |
136 | | - "name": "string.quoted.triple.literal", |
137 | 143 | "patterns": [{ |
138 | | - "include": "#stringTemplates" |
| 144 | + "name": "constant.character.escape.effekt", |
| 145 | + "match": "\\\\((u[0-9a-fA-F]{4})|.)" |
139 | 146 | }, { |
140 | | - "match": "\\\\.", |
141 | | - "name": "constant.character.escape.effekt" |
| 147 | + "include": "#stringTemplates" |
142 | 148 | }] |
143 | 149 | }, { |
| 150 | + "name": "string.quoted.double.effekt", |
144 | 151 | "begin": "\"", |
145 | 152 | "end": "\"", |
146 | | - "name": "string.quoted.double.literal", |
147 | 153 | "patterns": [{ |
148 | | - "include": "#stringTemplates" |
| 154 | + "name": "constant.character.escape.effekt", |
| 155 | + "match": "\\\\((u[0-9a-fA-F]{4})|.)" |
149 | 156 | }, { |
150 | | - "match": "\\\\.", |
151 | | - "name": "constant.character.escape.effekt" |
| 157 | + "include": "#stringTemplates" |
152 | 158 | }] |
153 | 159 | }] |
154 | 160 | }, |
| 161 | + "names": { |
| 162 | + "patterns": [{ |
| 163 | + "match": "\\b([a-z][a-zA-Z0-9_]*)\\b[\\s]*[({\\[]", |
| 164 | + "captures": { |
| 165 | + "1": { "name": "entity.name.function" } |
| 166 | + } |
| 167 | + }, { |
| 168 | + "match": "\\b[a-z][a-zA-Z0-9_]*\\b", |
| 169 | + "name": "variable" |
| 170 | + }, { |
| 171 | + "match": "\\b[A-Z][a-zA-Z0-9_]*\\b", |
| 172 | + "name": "entity.name.type" |
| 173 | + }] |
| 174 | + }, |
155 | 175 | "stringTemplates": { |
156 | 176 | "begin": "\\$\\{", |
157 | 177 | "beginCaptures": { |
|
166 | 186 | { "include": "$self" } |
167 | 187 | ] |
168 | 188 | }, |
169 | | - "characters": { |
170 | | - "patterns": [{ |
171 | | - "match": "'(\\\\[nrt\\\\']|[^'\\\\])'", |
172 | | - "name": "string.quoted.single.char.effekt" |
173 | | - }, { |
174 | | - "match": "\\\\u[0-9A-Fa-f]{4}", |
175 | | - "name": "string.quoted.single.char.effekt" |
176 | | - }] |
177 | | - }, |
178 | | - "numbers": { |
179 | | - "patterns": [ |
180 | | - { |
181 | | - "match": "\\b([0-9]+\\.[0-9]+)\\b", |
182 | | - "name": "constant.numeric.float.effekt" |
183 | | - }, |
184 | | - { |
185 | | - "match": "\\b([0-9]+)\\b", |
186 | | - "name": "constant.numeric.integer.effekt" |
187 | | - } |
188 | | - ] |
189 | | - }, |
190 | 189 | "punctuation": { |
191 | 190 | "patterns": [{ |
192 | 191 | "match": "[{}\\(\\)\\[\\];,]", |
|
0 commit comments