@konomanoasa/tree-sitter-yaml 0.1.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/Cargo.toml +36 -0
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/bindings/rust/build.rs +23 -0
- package/bindings/rust/lib.rs +12 -0
- package/grammar.js +820 -0
- package/package.json +45 -0
- package/queries/highlights.scm +89 -0
- package/src/grammar.json +6888 -0
- package/src/node-types.json +2561 -0
- package/src/parser.c +119335 -0
- package/src/scanner.c +2655 -0
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +336 -0
- package/src/tree_sitter/parser.h +286 -0
- package/test/bindings.test.rs +562 -0
- package/tree-sitter.json +30 -0
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@konomanoasa/tree-sitter-yaml",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Tree-sitter grammar for YAML.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": "git+https://github.com/konomanoasa/tree-sitter-yaml.git",
|
|
8
|
+
"files": [
|
|
9
|
+
"Cargo.toml",
|
|
10
|
+
"bindings/rust/*.rs",
|
|
11
|
+
"grammar.js",
|
|
12
|
+
"queries/*.scm",
|
|
13
|
+
"src/*.c",
|
|
14
|
+
"src/*.json",
|
|
15
|
+
"src/tree_sitter/*.h",
|
|
16
|
+
"test/bindings.test.rs",
|
|
17
|
+
"tree-sitter.json"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "npm run tree-sitter -- build-all",
|
|
24
|
+
"check": "biome check . && node scripts/check-c.js && node scripts/check-generated.js && npm test",
|
|
25
|
+
"format": "biome check --write . && node scripts/check-c.js --write",
|
|
26
|
+
"generate": "npm run tree-sitter -- generate-all",
|
|
27
|
+
"test": "npm run tree-sitter -- test-corpus --rebuild && node --test --test-concurrency=1 \"test/*.test.js\"",
|
|
28
|
+
"test:bindings": "cargo test --locked",
|
|
29
|
+
"test:fuzz": "node --test --test-name-pattern=\"fixed-seed generated histories\" test/incremental.test.js",
|
|
30
|
+
"test:fuzz:corpus": "npm run tree-sitter -- fuzz-all --iterations 100 --edits 5",
|
|
31
|
+
"test:highlights": "node --test test/highlight.test.js",
|
|
32
|
+
"test:incremental": "node --test test/incremental.test.js",
|
|
33
|
+
"test:sanitize": "node scripts/check-c.js --sanitize",
|
|
34
|
+
"test:scanner": "node scripts/check-c.js",
|
|
35
|
+
"tree-sitter": "node scripts/tree-sitter.js"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@biomejs/biome": "2.5.14",
|
|
39
|
+
"@types/node": "26.5.1",
|
|
40
|
+
"tree-sitter-cli": "0.27.0"
|
|
41
|
+
},
|
|
42
|
+
"allowScripts": {
|
|
43
|
+
"tree-sitter-cli": true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
[
|
|
2
|
+
(comment_marker)
|
|
3
|
+
(comment_text)
|
|
4
|
+
] @comment
|
|
5
|
+
|
|
6
|
+
[
|
|
7
|
+
(scalar_text)
|
|
8
|
+
(quote_open)
|
|
9
|
+
(quote_close)
|
|
10
|
+
(directive_parameter)
|
|
11
|
+
] @string
|
|
12
|
+
|
|
13
|
+
[
|
|
14
|
+
(quoted_escape)
|
|
15
|
+
(escaped_quote)
|
|
16
|
+
(escape_indicator)
|
|
17
|
+
(uri_escape)
|
|
18
|
+
] @string.escape
|
|
19
|
+
|
|
20
|
+
[
|
|
21
|
+
(anchor_name)
|
|
22
|
+
(alias_name)
|
|
23
|
+
] @label
|
|
24
|
+
|
|
25
|
+
[
|
|
26
|
+
(tag_handle_name)
|
|
27
|
+
(tag_suffix_text)
|
|
28
|
+
(uri_text)
|
|
29
|
+
] @type
|
|
30
|
+
|
|
31
|
+
[
|
|
32
|
+
(directive_indicator)
|
|
33
|
+
(directive_name)
|
|
34
|
+
] @keyword.directive
|
|
35
|
+
|
|
36
|
+
[
|
|
37
|
+
(yaml_version)
|
|
38
|
+
(indentation_indicator)
|
|
39
|
+
] @number
|
|
40
|
+
|
|
41
|
+
[
|
|
42
|
+
(flow_sequence_open)
|
|
43
|
+
(flow_sequence_close)
|
|
44
|
+
(flow_mapping_open)
|
|
45
|
+
(flow_mapping_close)
|
|
46
|
+
] @punctuation.bracket
|
|
47
|
+
|
|
48
|
+
[
|
|
49
|
+
(sequence_indicator)
|
|
50
|
+
(key_indicator)
|
|
51
|
+
(value_indicator)
|
|
52
|
+
(flow_separator)
|
|
53
|
+
(anchor_indicator)
|
|
54
|
+
(alias_indicator)
|
|
55
|
+
(primary_tag_handle)
|
|
56
|
+
(secondary_tag_handle)
|
|
57
|
+
(tag_handle_open)
|
|
58
|
+
(tag_handle_close)
|
|
59
|
+
(verbatim_tag_open)
|
|
60
|
+
(verbatim_tag_close)
|
|
61
|
+
(non_specific_tag)
|
|
62
|
+
] @punctuation.delimiter
|
|
63
|
+
|
|
64
|
+
[
|
|
65
|
+
(document_start)
|
|
66
|
+
(document_end)
|
|
67
|
+
(literal_indicator)
|
|
68
|
+
(folded_indicator)
|
|
69
|
+
(chomping_indicator)
|
|
70
|
+
] @punctuation.special
|
|
71
|
+
|
|
72
|
+
(_
|
|
73
|
+
key: [
|
|
74
|
+
(plain_scalar
|
|
75
|
+
(scalar_text) @property)
|
|
76
|
+
(single_quoted_scalar
|
|
77
|
+
(scalar_text) @property)
|
|
78
|
+
(double_quoted_scalar
|
|
79
|
+
(scalar_text) @property)
|
|
80
|
+
(node_with_properties
|
|
81
|
+
content: [
|
|
82
|
+
(plain_scalar
|
|
83
|
+
(scalar_text) @property)
|
|
84
|
+
(single_quoted_scalar
|
|
85
|
+
(scalar_text) @property)
|
|
86
|
+
(double_quoted_scalar
|
|
87
|
+
(scalar_text) @property)
|
|
88
|
+
])
|
|
89
|
+
])
|