tree-sitter-familymarkup 1.9.1 → 1.10.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 +2 -1
- package/package.json +3 -1
- package/queries/highlights.scm +11 -26
- package/queries.json +3 -0
- package/src/grammar.json +21 -8
- package/src/node-types.json +5 -5
- package/src/parser.c +888 -699
- package/tree-sitter.json +36 -0
package/grammar.js
CHANGED
@@ -47,7 +47,7 @@ module.exports = grammar({
|
|
47
47
|
field('delimiter', choice('+', ',', $._words))
|
48
48
|
),
|
49
49
|
targets: $ => repeatWith(
|
50
|
-
choice($.
|
50
|
+
choice($.name_def, $.num_unknown, $.unknown, $.comment),
|
51
51
|
field('delimiter', choice(',', $._nl, $._words))
|
52
52
|
),
|
53
53
|
|
@@ -63,6 +63,7 @@ module.exports = grammar({
|
|
63
63
|
field('surname', optional($.new_surname)),
|
64
64
|
field('name', $.name),
|
65
65
|
field('aliases', optional($.name_aliases)),
|
66
|
+
field('surname', optional(alias($.name, $.surname))),
|
66
67
|
),
|
67
68
|
|
68
69
|
num: _ => /\d+[.)]?/,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "tree-sitter-familymarkup",
|
3
3
|
"description": "Tree sitter for FamilyMarkup",
|
4
|
-
"version": "1.
|
4
|
+
"version": "1.10.0",
|
5
5
|
"main": "bindings/node",
|
6
6
|
"types": "bindings/node",
|
7
7
|
"scripts": {
|
@@ -18,6 +18,8 @@
|
|
18
18
|
"files": [
|
19
19
|
"grammar.js",
|
20
20
|
"binding.gyp",
|
21
|
+
"tree-sitter.json",
|
22
|
+
"queries.json",
|
21
23
|
"prebuilds/**",
|
22
24
|
"bindings/node/*",
|
23
25
|
"queries/*",
|
package/queries/highlights.scm
CHANGED
@@ -1,56 +1,41 @@
|
|
1
1
|
(family_name
|
2
2
|
(name) @class.declaration.family_name
|
3
|
-
)
|
4
3
|
|
5
|
-
(family_name
|
6
4
|
(name_aliases
|
7
5
|
(name) @class.declaration.family_name.alias
|
8
|
-
)
|
6
|
+
)?
|
9
7
|
)
|
10
8
|
|
11
9
|
(name_ref
|
10
|
+
(name) @property.static.name.ref
|
12
11
|
(surname) @class.family_name.ref
|
13
12
|
)
|
14
13
|
|
15
|
-
(
|
14
|
+
(name_def
|
16
15
|
(name) @property.static.name.ref
|
17
|
-
)
|
18
|
-
|
19
|
-
(name_def
|
20
|
-
(name) @property.declaration.static.name.def
|
21
|
-
)
|
22
|
-
|
23
|
-
(name_def
|
24
|
-
(name_aliases (name) @property.declaration.static.name.def.alias)
|
16
|
+
(surname)? @class.family_name.ref
|
25
17
|
)
|
26
18
|
|
27
19
|
(sources
|
28
20
|
(name) @property.static.name.ref
|
29
21
|
)
|
30
22
|
|
31
|
-
(targets
|
32
|
-
(name_def
|
33
|
-
.
|
34
|
-
(name) @property.static.name.ref
|
35
|
-
.
|
36
|
-
)
|
37
|
-
)
|
38
|
-
|
39
23
|
(relation
|
40
24
|
arrow: "="
|
41
25
|
(targets
|
42
26
|
(name_def
|
43
|
-
|
27
|
+
(new_surname
|
28
|
+
(name) @class.family_name.ref
|
29
|
+
)?
|
44
30
|
(name) @property.declaration.static.name.def
|
45
|
-
|
31
|
+
(name_aliases
|
32
|
+
(name) @property.declaration.static.name.def.alias
|
33
|
+
)?
|
34
|
+
(surname)? @class.family_name.ref
|
46
35
|
)
|
47
36
|
)
|
48
37
|
)
|
49
38
|
|
50
|
-
(new_surname
|
51
|
-
(name) @class.family_name.ref
|
52
|
-
)
|
53
|
-
|
54
39
|
(unknown) @string.unknown
|
55
40
|
|
56
41
|
(comment) @comment
|
package/queries.json
ADDED
@@ -0,0 +1,3 @@
|
|
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 arrow: \"=\"\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
|
+
}
|
package/src/grammar.json
CHANGED
@@ -354,10 +354,6 @@
|
|
354
354
|
{
|
355
355
|
"type": "CHOICE",
|
356
356
|
"members": [
|
357
|
-
{
|
358
|
-
"type": "SYMBOL",
|
359
|
-
"name": "name_ref"
|
360
|
-
},
|
361
357
|
{
|
362
358
|
"type": "SYMBOL",
|
363
359
|
"name": "name_def"
|
@@ -408,10 +404,6 @@
|
|
408
404
|
{
|
409
405
|
"type": "CHOICE",
|
410
406
|
"members": [
|
411
|
-
{
|
412
|
-
"type": "SYMBOL",
|
413
|
-
"name": "name_ref"
|
414
|
-
},
|
415
407
|
{
|
416
408
|
"type": "SYMBOL",
|
417
409
|
"name": "name_def"
|
@@ -545,6 +537,27 @@
|
|
545
537
|
}
|
546
538
|
]
|
547
539
|
}
|
540
|
+
},
|
541
|
+
{
|
542
|
+
"type": "FIELD",
|
543
|
+
"name": "surname",
|
544
|
+
"content": {
|
545
|
+
"type": "CHOICE",
|
546
|
+
"members": [
|
547
|
+
{
|
548
|
+
"type": "ALIAS",
|
549
|
+
"content": {
|
550
|
+
"type": "SYMBOL",
|
551
|
+
"name": "name"
|
552
|
+
},
|
553
|
+
"named": true,
|
554
|
+
"value": "surname"
|
555
|
+
},
|
556
|
+
{
|
557
|
+
"type": "BLANK"
|
558
|
+
}
|
559
|
+
]
|
560
|
+
}
|
548
561
|
}
|
549
562
|
]
|
550
563
|
},
|
package/src/node-types.json
CHANGED
@@ -110,12 +110,16 @@
|
|
110
110
|
]
|
111
111
|
},
|
112
112
|
"surname": {
|
113
|
-
"multiple":
|
113
|
+
"multiple": true,
|
114
114
|
"required": false,
|
115
115
|
"types": [
|
116
116
|
{
|
117
117
|
"type": "new_surname",
|
118
118
|
"named": true
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"type": "surname",
|
122
|
+
"named": true
|
119
123
|
}
|
120
124
|
]
|
121
125
|
}
|
@@ -340,10 +344,6 @@
|
|
340
344
|
"type": "name_def",
|
341
345
|
"named": true
|
342
346
|
},
|
343
|
-
{
|
344
|
-
"type": "name_ref",
|
345
|
-
"named": true
|
346
|
-
},
|
347
347
|
{
|
348
348
|
"type": "num_unknown",
|
349
349
|
"named": true
|