tree-sitter-kdl 1.0.0 → 1.0.2
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/.gitattributes +4 -0
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/fuzz.yml +1 -1
- package/.github/workflows/{build.yml → publish.yml} +1 -1
- package/Cargo.toml +11 -6
- package/LICENSE +21 -0
- package/Package.swift +38 -0
- package/README.md +3 -0
- package/binding.gyp +0 -1
- package/bindings/node/binding.cc +7 -5
- package/bindings/node/index.js +4 -4
- package/bindings/rust/README.md +36 -0
- package/bindings/rust/build.rs +0 -19
- package/bindings/rust/lib.rs +22 -10
- package/bindings/swift/kdl.h +16 -0
- package/grammar.js +47 -40
- package/package.json +27 -13
- package/queries/folds.scm +6 -1
- package/queries/highlights.scm +1 -1
- package/queries/indents.scm +7 -0
- package/queries/injections.scm +4 -0
- package/queries/locals.scm +10 -0
- package/examples/01-basic.kdl +0 -1
- package/examples/02-multiple-values.kdl +0 -1
- package/examples/03-properties.kdl +0 -1
- package/examples/04-child-nodes.kdl +0 -6
- package/examples/05-node-terminators.kdl +0 -1
- package/examples/06-string-formats.kdl +0 -2
- package/examples/07-multiline-string.kdl +0 -3
- package/examples/08-raw-string.kdl +0 -1
- package/examples/09-number.kdl +0 -1
- package/examples/10-number-forms.kdl +0 -3
- package/examples/11-number-with-underscores.kdl +0 -1
- package/examples/12-comments.kdl +0 -11
- package/examples/13-slashdash-comments.kdl +0 -11
- package/examples/14-type-annotations.kdl +0 -4
- package/examples/15-rich-example.kdl +0 -21
- package/script/known_failures.txt +0 -0
- package/script/parse-examples +0 -40
- package/test/corpus/node.txt +0 -2784
package/examples/01-basic.kdl
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
title "Hello, World"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bookmarks 12 15 188 1234
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
author "Alex Monad" email="alex@example.com" active=true
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node1; node2; node3;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
other-raw r#"hello"world"#
|
package/examples/09-number.kdl
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
num 1.234e-42
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bignum 1_000_000
|
package/examples/12-comments.kdl
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Nodes can be separated into multiple lines
|
|
2
|
-
title \
|
|
3
|
-
"Some title"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// Files must be utf8 encoded!
|
|
7
|
-
smile "😁"
|
|
8
|
-
|
|
9
|
-
// Instead of anonymous nodes, nodes and properties can be wrapped
|
|
10
|
-
// in "" for arbitrary node names.
|
|
11
|
-
"!@#$@$%Q#$%~@!40" "1.2.3" "!!!!!"=true
|
|
12
|
-
|
|
13
|
-
// The following is a legal bare identifier:
|
|
14
|
-
foo123~!@#$%^&*.:'|?+ "weeee"
|
|
15
|
-
|
|
16
|
-
// And you can also use unicode!
|
|
17
|
-
ノード お名前="☜(゚ヮ゚☜)"
|
|
18
|
-
|
|
19
|
-
// kdl specifically allows properties and values to be
|
|
20
|
-
// interspersed with each other, much like CLI commands.
|
|
21
|
-
foo bar=true "baz" quux=false 1 2 3
|
|
File without changes
|
package/script/parse-examples
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
set -e
|
|
4
|
-
|
|
5
|
-
cd "$(dirname "$0")/.."
|
|
6
|
-
|
|
7
|
-
function checkout() {
|
|
8
|
-
repo=$1; url=$2; sha=$3
|
|
9
|
-
|
|
10
|
-
if [ ! -d "$repo" ]; then
|
|
11
|
-
git clone "https://github.com/$url" "$repo"
|
|
12
|
-
fi
|
|
13
|
-
|
|
14
|
-
pushd "$repo"
|
|
15
|
-
git fetch && git reset --hard "$sha"
|
|
16
|
-
popd
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
checkout examples/kdl kdl-org/kdl 6feeccc491808fe0b5425a18aa7ab4a8ac435e55
|
|
20
|
-
checkout examples/kdl-rs kdl-org/kdl-rs 8c028e5ea189470f07c5c848ab778f3d63ba89ab
|
|
21
|
-
checkout examples/kdl-js kdl-org/kdljs bb874a595e6f712950795ecaad62f24fd945f03d
|
|
22
|
-
checkout examples/kdl-php kdl-org/kdl-php 390fdc5ab8e2749feb01a113e8feb028de0861b3
|
|
23
|
-
|
|
24
|
-
known_failures="$(cat script/known_failures.txt)"
|
|
25
|
-
|
|
26
|
-
# Remove input directories
|
|
27
|
-
find examples -type d -name input -exec rm -rf {} +
|
|
28
|
-
|
|
29
|
-
tree-sitter parse -q \
|
|
30
|
-
'examples/**/*.kdl' \
|
|
31
|
-
"$(for file in $known_failures; do echo "!${file}"; done)"
|
|
32
|
-
|
|
33
|
-
example_count=$(find examples -name '*.kdl' | wc -l)
|
|
34
|
-
failure_count=$(wc -w <<< "$known_failures")
|
|
35
|
-
success_count=$(( example_count - failure_count ))
|
|
36
|
-
success_percent=$(bc -l <<< "100*${success_count}/${example_count}")
|
|
37
|
-
|
|
38
|
-
printf \
|
|
39
|
-
"Successfully parsed %d of %d example files (%.1f%%)\n" \
|
|
40
|
-
$success_count "$example_count" "$success_percent"
|