tree-sitter-familymarkup 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/grammar.js +4 -2
- package/package.json +1 -1
- package/queries/highlights.scm +2 -1
- package/queries.json +1 -1
- package/src/grammar.json +16 -7
- package/src/node-types.json +13 -20
- package/src/parser.c +748 -726
package/grammar.js
CHANGED
@@ -36,7 +36,7 @@ module.exports = grammar({
|
|
36
36
|
|
37
37
|
relation: $ => seq(
|
38
38
|
field('sources', $.sources),
|
39
|
-
field('arrow', $.
|
39
|
+
field('arrow', choice($.eq, $.arrow)),
|
40
40
|
field('label', optional($.words)),
|
41
41
|
optional($._nl),
|
42
42
|
field('targets', optional($.targets)),
|
@@ -86,7 +86,9 @@ module.exports = grammar({
|
|
86
86
|
words: _ => /\p{Ll}([\p{Ll}'"\s]*[\p{Ll}'"])?/u,
|
87
87
|
_words: $ => alias($.words, '_words'),
|
88
88
|
|
89
|
-
|
89
|
+
eq: _ => "=",
|
90
|
+
|
91
|
+
arrow: _ => choice('<->', '->', '<-', '-'),
|
90
92
|
},
|
91
93
|
});
|
92
94
|
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/queries.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
{
|
2
|
-
"highlights": "(family_name\n (name) @class.declaration.family_name\n\n (name_aliases\n (name) @class.declaration.family_name.alias\n )?\n)\n\n(name_ref\n (name) @property.static.name.ref\n (surname) @class.family_name.ref\n)\n\n(name_def\n (name) @property.static.name.ref\n (surname)? @class.family_name.ref\n)\n\n(sources\n (name) @property.static.name.ref\n)\n\n(relation\n
|
2
|
+
"highlights": "(family_name\n (name) @class.declaration.family_name\n\n (name_aliases\n (name) @class.declaration.family_name.alias\n )?\n)\n\n(name_ref\n (name) @property.static.name.ref\n (surname) @class.family_name.ref\n)\n\n(name_def\n (name) @property.static.name.ref\n (surname)? @class.family_name.ref\n)\n\n(sources\n (name) @property.static.name.ref\n)\n\n(relation\n (sources)\n (eq)\n (targets\n (name_def\n (new_surname\n (name) @class.family_name.ref\n )?\n (name) @property.declaration.static.name.def\n (name_aliases\n (name) @property.declaration.static.name.def.alias\n )?\n (surname)? @class.family_name.ref\n )\n )\n)\n\n(unknown) @string.unknown\n\n(comment) @comment\n\n(num) @number.targets\n\n(sources delimiter: _ @punctuation.delimiter.sources)\n(targets delimiter: _ @punctuation.delimiter.targets)\n\n\"+\" @operator.sources.join\n\n(relation arrow: _ @operator.arrow)\n\n(relation label: _ @string.label)\n"
|
3
3
|
}
|
package/src/grammar.json
CHANGED
@@ -222,8 +222,17 @@
|
|
222
222
|
"type": "FIELD",
|
223
223
|
"name": "arrow",
|
224
224
|
"content": {
|
225
|
-
"type": "
|
226
|
-
"
|
225
|
+
"type": "CHOICE",
|
226
|
+
"members": [
|
227
|
+
{
|
228
|
+
"type": "SYMBOL",
|
229
|
+
"name": "eq"
|
230
|
+
},
|
231
|
+
{
|
232
|
+
"type": "SYMBOL",
|
233
|
+
"name": "arrow"
|
234
|
+
}
|
235
|
+
]
|
227
236
|
}
|
228
237
|
},
|
229
238
|
{
|
@@ -716,13 +725,13 @@
|
|
716
725
|
"named": false,
|
717
726
|
"value": "_words"
|
718
727
|
},
|
719
|
-
"
|
728
|
+
"eq": {
|
729
|
+
"type": "STRING",
|
730
|
+
"value": "="
|
731
|
+
},
|
732
|
+
"arrow": {
|
720
733
|
"type": "CHOICE",
|
721
734
|
"members": [
|
722
|
-
{
|
723
|
-
"type": "STRING",
|
724
|
-
"value": "="
|
725
|
-
},
|
726
735
|
{
|
727
736
|
"type": "STRING",
|
728
737
|
"value": "<->"
|
package/src/node-types.json
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"type": "arrow",
|
4
|
+
"named": true,
|
5
|
+
"fields": {}
|
6
|
+
},
|
2
7
|
{
|
3
8
|
"type": "comment",
|
4
9
|
"named": true,
|
@@ -187,24 +192,12 @@
|
|
187
192
|
"required": true,
|
188
193
|
"types": [
|
189
194
|
{
|
190
|
-
"type": "
|
191
|
-
"named":
|
192
|
-
},
|
193
|
-
{
|
194
|
-
"type": "->",
|
195
|
-
"named": false
|
196
|
-
},
|
197
|
-
{
|
198
|
-
"type": "<-",
|
199
|
-
"named": false
|
200
|
-
},
|
201
|
-
{
|
202
|
-
"type": "<->",
|
203
|
-
"named": false
|
195
|
+
"type": "arrow",
|
196
|
+
"named": true
|
204
197
|
},
|
205
198
|
{
|
206
|
-
"type": "
|
207
|
-
"named":
|
199
|
+
"type": "eq",
|
200
|
+
"named": true
|
208
201
|
}
|
209
202
|
]
|
210
203
|
},
|
@@ -404,10 +397,6 @@
|
|
404
397
|
"type": "<->",
|
405
398
|
"named": false
|
406
399
|
},
|
407
|
-
{
|
408
|
-
"type": "=",
|
409
|
-
"named": false
|
410
|
-
},
|
411
400
|
{
|
412
401
|
"type": "?",
|
413
402
|
"named": false
|
@@ -416,6 +405,10 @@
|
|
416
405
|
"type": "_words",
|
417
406
|
"named": false
|
418
407
|
},
|
408
|
+
{
|
409
|
+
"type": "eq",
|
410
|
+
"named": true
|
411
|
+
},
|
419
412
|
{
|
420
413
|
"type": "name",
|
421
414
|
"named": true
|