@apple/tree-sitter-pkl 0.20.0 → 0.21.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/.editorconfig +3 -0
- package/.github/PklProject +26 -0
- package/.github/PklProject.deps.json +40 -0
- package/.github/dependabot.yml +18 -0
- package/.github/index.pkl +159 -0
- package/.github/workflows/__lockfile__.yml +28 -0
- package/.github/workflows/build.yml +48 -0
- package/.github/workflows/codeql.yml +28 -0
- package/.github/workflows/main.yml +46 -0
- package/.github/workflows/prb.yml +96 -0
- package/.github/workflows/release.yml +68 -0
- package/CHANGELOG.adoc +20 -0
- package/CMakeLists.txt +1 -1
- package/Cargo.lock +155 -19
- package/Cargo.toml +16 -11
- package/Makefile +1 -1
- package/{SECURITY.adoc → SECURITY.md} +3 -3
- package/gradlew +3 -6
- package/gradlew.bat +1 -2
- package/grammar.js +22 -3
- package/package.json +6 -6
- package/pyproject.toml +1 -1
- package/src/grammar.json +107 -0
- package/src/node-types.json +8 -0
- package/src/parser.c +6432 -6150
- package/src/scanner.c +3 -3
- package/src/tree_sitter/array.h +110 -71
- package/tree-sitter.json +1 -1
package/Cargo.lock
CHANGED
|
@@ -1,42 +1,89 @@
|
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
|
-
version =
|
|
3
|
+
version = 4
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "aho-corasick"
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.4"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
|
10
10
|
dependencies = [
|
|
11
11
|
"memchr",
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
[[package]]
|
|
15
15
|
name = "cc"
|
|
16
|
-
version = "1.
|
|
16
|
+
version = "1.2.47"
|
|
17
17
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
-
checksum = "
|
|
18
|
+
checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07"
|
|
19
19
|
dependencies = [
|
|
20
|
-
"
|
|
20
|
+
"find-msvc-tools",
|
|
21
|
+
"shlex",
|
|
21
22
|
]
|
|
22
23
|
|
|
23
24
|
[[package]]
|
|
24
|
-
name = "
|
|
25
|
-
version = "0.2
|
|
25
|
+
name = "equivalent"
|
|
26
|
+
version = "1.0.2"
|
|
26
27
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
-
checksum = "
|
|
28
|
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
29
|
+
|
|
30
|
+
[[package]]
|
|
31
|
+
name = "find-msvc-tools"
|
|
32
|
+
version = "0.1.5"
|
|
33
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
34
|
+
checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
|
|
35
|
+
|
|
36
|
+
[[package]]
|
|
37
|
+
name = "hashbrown"
|
|
38
|
+
version = "0.16.1"
|
|
39
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
40
|
+
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
|
41
|
+
|
|
42
|
+
[[package]]
|
|
43
|
+
name = "indexmap"
|
|
44
|
+
version = "2.12.1"
|
|
45
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
46
|
+
checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2"
|
|
47
|
+
dependencies = [
|
|
48
|
+
"equivalent",
|
|
49
|
+
"hashbrown",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[[package]]
|
|
53
|
+
name = "itoa"
|
|
54
|
+
version = "1.0.15"
|
|
55
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
56
|
+
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
|
28
57
|
|
|
29
58
|
[[package]]
|
|
30
59
|
name = "memchr"
|
|
31
|
-
version = "2.7.
|
|
60
|
+
version = "2.7.6"
|
|
32
61
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
-
checksum = "
|
|
62
|
+
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
|
|
63
|
+
|
|
64
|
+
[[package]]
|
|
65
|
+
name = "proc-macro2"
|
|
66
|
+
version = "1.0.103"
|
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
+
checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
|
|
69
|
+
dependencies = [
|
|
70
|
+
"unicode-ident",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[[package]]
|
|
74
|
+
name = "quote"
|
|
75
|
+
version = "1.0.42"
|
|
76
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
+
checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f"
|
|
78
|
+
dependencies = [
|
|
79
|
+
"proc-macro2",
|
|
80
|
+
]
|
|
34
81
|
|
|
35
82
|
[[package]]
|
|
36
83
|
name = "regex"
|
|
37
|
-
version = "1.
|
|
84
|
+
version = "1.12.2"
|
|
38
85
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
-
checksum = "
|
|
86
|
+
checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
|
|
40
87
|
dependencies = [
|
|
41
88
|
"aho-corasick",
|
|
42
89
|
"memchr",
|
|
@@ -46,9 +93,9 @@ dependencies = [
|
|
|
46
93
|
|
|
47
94
|
[[package]]
|
|
48
95
|
name = "regex-automata"
|
|
49
|
-
version = "0.4.
|
|
96
|
+
version = "0.4.13"
|
|
50
97
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
51
|
-
checksum = "
|
|
98
|
+
checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
|
|
52
99
|
dependencies = [
|
|
53
100
|
"aho-corasick",
|
|
54
101
|
"memchr",
|
|
@@ -57,24 +104,113 @@ dependencies = [
|
|
|
57
104
|
|
|
58
105
|
[[package]]
|
|
59
106
|
name = "regex-syntax"
|
|
60
|
-
version = "0.8.
|
|
107
|
+
version = "0.8.8"
|
|
108
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
109
|
+
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
|
110
|
+
|
|
111
|
+
[[package]]
|
|
112
|
+
name = "ryu"
|
|
113
|
+
version = "1.0.20"
|
|
114
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
115
|
+
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
|
116
|
+
|
|
117
|
+
[[package]]
|
|
118
|
+
name = "serde"
|
|
119
|
+
version = "1.0.228"
|
|
120
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
121
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
122
|
+
dependencies = [
|
|
123
|
+
"serde_core",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "serde_core"
|
|
128
|
+
version = "1.0.228"
|
|
61
129
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
62
|
-
checksum = "
|
|
130
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"serde_derive",
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
[[package]]
|
|
136
|
+
name = "serde_derive"
|
|
137
|
+
version = "1.0.228"
|
|
138
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
139
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
140
|
+
dependencies = [
|
|
141
|
+
"proc-macro2",
|
|
142
|
+
"quote",
|
|
143
|
+
"syn",
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
[[package]]
|
|
147
|
+
name = "serde_json"
|
|
148
|
+
version = "1.0.145"
|
|
149
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
+
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
|
|
151
|
+
dependencies = [
|
|
152
|
+
"indexmap",
|
|
153
|
+
"itoa",
|
|
154
|
+
"memchr",
|
|
155
|
+
"ryu",
|
|
156
|
+
"serde",
|
|
157
|
+
"serde_core",
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
[[package]]
|
|
161
|
+
name = "shlex"
|
|
162
|
+
version = "1.3.0"
|
|
163
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
164
|
+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
165
|
+
|
|
166
|
+
[[package]]
|
|
167
|
+
name = "streaming-iterator"
|
|
168
|
+
version = "0.1.9"
|
|
169
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
170
|
+
checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
|
|
171
|
+
|
|
172
|
+
[[package]]
|
|
173
|
+
name = "syn"
|
|
174
|
+
version = "2.0.111"
|
|
175
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
176
|
+
checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87"
|
|
177
|
+
dependencies = [
|
|
178
|
+
"proc-macro2",
|
|
179
|
+
"quote",
|
|
180
|
+
"unicode-ident",
|
|
181
|
+
]
|
|
63
182
|
|
|
64
183
|
[[package]]
|
|
65
184
|
name = "tree-sitter"
|
|
66
|
-
version = "0.
|
|
185
|
+
version = "0.25.10"
|
|
67
186
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
-
checksum = "
|
|
187
|
+
checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87"
|
|
69
188
|
dependencies = [
|
|
70
189
|
"cc",
|
|
71
190
|
"regex",
|
|
191
|
+
"regex-syntax",
|
|
192
|
+
"serde_json",
|
|
193
|
+
"streaming-iterator",
|
|
194
|
+
"tree-sitter-language",
|
|
72
195
|
]
|
|
73
196
|
|
|
197
|
+
[[package]]
|
|
198
|
+
name = "tree-sitter-language"
|
|
199
|
+
version = "0.1.5"
|
|
200
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
201
|
+
checksum = "c4013970217383f67b18aef68f6fb2e8d409bc5755227092d32efb0422ba24b8"
|
|
202
|
+
|
|
74
203
|
[[package]]
|
|
75
204
|
name = "tree-sitter-pkl"
|
|
76
205
|
version = "0.20.0"
|
|
77
206
|
dependencies = [
|
|
78
207
|
"cc",
|
|
79
208
|
"tree-sitter",
|
|
209
|
+
"tree-sitter-language",
|
|
80
210
|
]
|
|
211
|
+
|
|
212
|
+
[[package]]
|
|
213
|
+
name = "unicode-ident"
|
|
214
|
+
version = "1.0.22"
|
|
215
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
216
|
+
checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
|
package/Cargo.toml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "tree-sitter-pkl"
|
|
3
|
-
description = "
|
|
4
|
-
version = "0.
|
|
5
|
-
|
|
6
|
-
categories = ["parsing", "text-editors"]
|
|
7
|
-
repository = "https://github.com/apple/tree-sitter-pkl"
|
|
8
|
-
edition = "2018"
|
|
3
|
+
description = "Parser for Pkl programming language"
|
|
4
|
+
version = "0.21.0"
|
|
5
|
+
authors = ["The Pkl Authors <pkl-oss@group.apple.com>"]
|
|
9
6
|
license = "Apache-2.0"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
keywords = ["incremental", "parsing", "tree-sitter", "pkl"]
|
|
9
|
+
categories = ["parser-implementations", "parsing", "text-editors"]
|
|
10
|
+
repository = "https://github.com/apple/tree-sitter-pkl"
|
|
11
|
+
edition = "2021"
|
|
12
|
+
autoexamples = false
|
|
13
13
|
|
|
14
14
|
build = "bindings/rust/build.rs"
|
|
15
15
|
include = [
|
|
@@ -17,13 +17,18 @@ include = [
|
|
|
17
17
|
"grammar.js",
|
|
18
18
|
"queries/*",
|
|
19
19
|
"src/*",
|
|
20
|
+
"tree-sitter.json",
|
|
21
|
+
"LICENSE.txt",
|
|
20
22
|
]
|
|
21
23
|
|
|
22
24
|
[lib]
|
|
23
25
|
path = "bindings/rust/lib.rs"
|
|
24
26
|
|
|
25
27
|
[dependencies]
|
|
26
|
-
tree-sitter = "
|
|
28
|
+
tree-sitter-language = "0.1"
|
|
27
29
|
|
|
28
30
|
[build-dependencies]
|
|
29
|
-
cc = "1.
|
|
31
|
+
cc = "1.2"
|
|
32
|
+
|
|
33
|
+
[dev-dependencies]
|
|
34
|
+
tree-sitter = "0.25.10"
|
package/Makefile
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# Security
|
|
2
2
|
|
|
3
3
|
For the protection of our community, the Pkl team does not disclose, discuss, or confirm security issues until our investigation is complete and any necessary updates are generally available.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Reporting a security vulnerability
|
|
6
6
|
|
|
7
7
|
If you have discovered a security vulnerability within the Tree-sitter Pkl project, please report it to us.
|
|
8
8
|
We welcome reports from everyone, including security researchers, developers, and users.
|
|
9
9
|
|
|
10
|
-
Security vulnerabilities may be reported on the
|
|
10
|
+
Security vulnerabilities may be reported on the [Report a vulnerability](https://security.apple.com/submit) form.
|
|
11
11
|
When submitting a vulnerability, select "Apple Devices and Software" as the affected platform, and "Open Source" as the affected area.
|
|
12
12
|
|
|
13
13
|
For more information, see https://pkl-lang.org/security.html.
|
package/gradlew
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
|
|
3
3
|
#
|
|
4
|
-
# Copyright © 2015
|
|
4
|
+
# Copyright © 2015 the original authors.
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
# Darwin, MinGW, and NonStop.
|
|
58
58
|
#
|
|
59
59
|
# (3) This script is generated from the Groovy template
|
|
60
|
-
# https://github.com/gradle/gradle/blob/
|
|
60
|
+
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
61
61
|
# within the Gradle project.
|
|
62
62
|
#
|
|
63
63
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
|
|
114
114
|
NONSTOP* ) nonstop=true ;;
|
|
115
115
|
esac
|
|
116
116
|
|
|
117
|
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
118
117
|
|
|
119
118
|
|
|
120
119
|
# Determine the Java command to use to start the JVM.
|
|
@@ -172,7 +171,6 @@ fi
|
|
|
172
171
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
173
172
|
if "$cygwin" || "$msys" ; then
|
|
174
173
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
175
|
-
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
176
174
|
|
|
177
175
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
178
176
|
|
|
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
|
212
210
|
|
|
213
211
|
set -- \
|
|
214
212
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
215
|
-
-
|
|
216
|
-
org.gradle.wrapper.GradleWrapperMain \
|
|
213
|
+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
|
217
214
|
"$@"
|
|
218
215
|
|
|
219
216
|
# Stop when "xargs" is not available.
|
package/gradlew.bat
CHANGED
|
@@ -70,11 +70,10 @@ goto fail
|
|
|
70
70
|
:execute
|
|
71
71
|
@rem Setup the command line
|
|
72
72
|
|
|
73
|
-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
74
73
|
|
|
75
74
|
|
|
76
75
|
@rem Execute Gradle
|
|
77
|
-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -
|
|
76
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
|
78
77
|
|
|
79
78
|
:end
|
|
80
79
|
@rem End local scope for the variables with windows NT shell
|
package/grammar.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
// noinspection JSUnusedLocalSymbols
|
|
2
|
-
|
|
3
1
|
/*
|
|
4
|
-
* Copyright © 2024-
|
|
2
|
+
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
5
3
|
*
|
|
6
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -633,6 +631,7 @@ module.exports = grammar({
|
|
|
633
631
|
'"""',
|
|
634
632
|
repeat(choice(
|
|
635
633
|
$.mlStringLiteralPart,
|
|
634
|
+
$.mlStringContinuation,
|
|
636
635
|
$.escapeSequence,
|
|
637
636
|
$.stringInterpolation
|
|
638
637
|
)),
|
|
@@ -643,6 +642,7 @@ module.exports = grammar({
|
|
|
643
642
|
repeat(choice(
|
|
644
643
|
alias($.mlStringLiteralPart1, $.mlStringLiteralPart),
|
|
645
644
|
alias($.escapeSequence1, $.escapeSequence),
|
|
645
|
+
alias($.mlStringContinuation1, $.mlStringContinuation),
|
|
646
646
|
alias($.stringInterpolation1, $.stringInterpolation)
|
|
647
647
|
)),
|
|
648
648
|
'"""#'
|
|
@@ -652,6 +652,7 @@ module.exports = grammar({
|
|
|
652
652
|
repeat(choice(
|
|
653
653
|
alias($.mlStringLiteralPart2, $.mlStringLiteralPart),
|
|
654
654
|
alias($.escapeSequence2, $.escapeSequence),
|
|
655
|
+
alias($.mlStringContinuation2, $.mlStringContinuation),
|
|
655
656
|
alias($.stringInterpolation2, $.stringInterpolation)
|
|
656
657
|
)),
|
|
657
658
|
'"""##'
|
|
@@ -661,6 +662,7 @@ module.exports = grammar({
|
|
|
661
662
|
repeat(choice(
|
|
662
663
|
alias($.mlStringLiteralPart3, $.mlStringLiteralPart),
|
|
663
664
|
alias($.escapeSequence3, $.escapeSequence),
|
|
665
|
+
alias($.mlStringContinuation3, $.mlStringContinuation),
|
|
664
666
|
alias($.stringInterpolation3, $.stringInterpolation)
|
|
665
667
|
)),
|
|
666
668
|
'"""###'
|
|
@@ -670,6 +672,7 @@ module.exports = grammar({
|
|
|
670
672
|
repeat(choice(
|
|
671
673
|
alias($.mlStringLiteralPart4, $.mlStringLiteralPart),
|
|
672
674
|
alias($.escapeSequence4, $.escapeSequence),
|
|
675
|
+
alias($.mlStringContinuation4, $.mlStringContinuation),
|
|
673
676
|
alias($.stringInterpolation4, $.stringInterpolation)
|
|
674
677
|
)),
|
|
675
678
|
'"""####'
|
|
@@ -679,6 +682,7 @@ module.exports = grammar({
|
|
|
679
682
|
repeat(choice(
|
|
680
683
|
alias($.mlStringLiteralPart5, $.mlStringLiteralPart),
|
|
681
684
|
alias($.escapeSequence5, $.escapeSequence),
|
|
685
|
+
alias($.mlStringContinuation5, $.mlStringContinuation),
|
|
682
686
|
alias($.stringInterpolation5, $.stringInterpolation)
|
|
683
687
|
)),
|
|
684
688
|
'"""#####'
|
|
@@ -688,6 +692,7 @@ module.exports = grammar({
|
|
|
688
692
|
repeat(choice(
|
|
689
693
|
alias($.mlStringLiteralPart6, $.mlStringLiteralPart),
|
|
690
694
|
alias($.escapeSequence6, $.escapeSequence),
|
|
695
|
+
alias($.mlStringContinuation6, $.mlStringContinuation),
|
|
691
696
|
alias($.stringInterpolation6, $.stringInterpolation)
|
|
692
697
|
)),
|
|
693
698
|
'"""######'
|
|
@@ -764,6 +769,20 @@ module.exports = grammar({
|
|
|
764
769
|
)
|
|
765
770
|
)),
|
|
766
771
|
|
|
772
|
+
mlStringContinuation: $ => token.immediate(/\\\r?\n/),
|
|
773
|
+
|
|
774
|
+
mlStringContinuation1: $ => token.immediate(/\\#\r?\n/),
|
|
775
|
+
|
|
776
|
+
mlStringContinuation2: $ => token.immediate(/\\##\r?\n/),
|
|
777
|
+
|
|
778
|
+
mlStringContinuation3: $ => token.immediate(/\\###\r?\n/),
|
|
779
|
+
|
|
780
|
+
mlStringContinuation4: $ => token.immediate(/\\####\r?\n/),
|
|
781
|
+
|
|
782
|
+
mlStringContinuation5: $ => token.immediate(/\\#####\r?\n/),
|
|
783
|
+
|
|
784
|
+
mlStringContinuation6: $ => token.immediate(/\\######\r?\n/),
|
|
785
|
+
|
|
767
786
|
stringInterpolation: $ => seq(token.immediate("\\("), $._expr, ")"),
|
|
768
787
|
|
|
769
788
|
stringInterpolation1: $ => seq(token.immediate("\\#("), $._expr, ")"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apple/tree-sitter-pkl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Pkl grammar for node-tree-sitter",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"url": "https://github.com/apple/tree-sitter-pkl/issues"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": "
|
|
21
|
-
"npm": "
|
|
20
|
+
"node": ">= 24",
|
|
21
|
+
"npm": ">= 11"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"node-addon-api": "^8.5.0",
|
|
25
25
|
"node-gyp-build": "^4.8.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"tree-sitter-cli": "^0.
|
|
29
|
-
"typescript": "^
|
|
28
|
+
"tree-sitter-cli": "^0.26.8",
|
|
29
|
+
"typescript": "^6.0.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"tree-sitter": "^0.25.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tree-sitter generate && node-gyp-build",
|
|
41
|
-
"generate": "tree-sitter generate
|
|
41
|
+
"generate": "tree-sitter generate",
|
|
42
42
|
"test": "tree-sitter test",
|
|
43
43
|
"getVersion": "node -p \"require('./package.json').version\""
|
|
44
44
|
},
|
package/pyproject.toml
CHANGED
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tree-sitter-pkl"
|
|
7
7
|
description = "Parser for Pkl programming language"
|
|
8
|
-
version = "0.
|
|
8
|
+
version = "0.21.0"
|
|
9
9
|
keywords = ["incremental", "parsing", "tree-sitter", "pkl"]
|
|
10
10
|
classifiers = [
|
|
11
11
|
"Intended Audience :: Developers",
|
package/src/grammar.json
CHANGED
|
@@ -2610,6 +2610,10 @@
|
|
|
2610
2610
|
"type": "SYMBOL",
|
|
2611
2611
|
"name": "mlStringLiteralPart"
|
|
2612
2612
|
},
|
|
2613
|
+
{
|
|
2614
|
+
"type": "SYMBOL",
|
|
2615
|
+
"name": "mlStringContinuation"
|
|
2616
|
+
},
|
|
2613
2617
|
{
|
|
2614
2618
|
"type": "SYMBOL",
|
|
2615
2619
|
"name": "escapeSequence"
|
|
@@ -2657,6 +2661,15 @@
|
|
|
2657
2661
|
"named": true,
|
|
2658
2662
|
"value": "escapeSequence"
|
|
2659
2663
|
},
|
|
2664
|
+
{
|
|
2665
|
+
"type": "ALIAS",
|
|
2666
|
+
"content": {
|
|
2667
|
+
"type": "SYMBOL",
|
|
2668
|
+
"name": "mlStringContinuation1"
|
|
2669
|
+
},
|
|
2670
|
+
"named": true,
|
|
2671
|
+
"value": "mlStringContinuation"
|
|
2672
|
+
},
|
|
2660
2673
|
{
|
|
2661
2674
|
"type": "ALIAS",
|
|
2662
2675
|
"content": {
|
|
@@ -2705,6 +2718,15 @@
|
|
|
2705
2718
|
"named": true,
|
|
2706
2719
|
"value": "escapeSequence"
|
|
2707
2720
|
},
|
|
2721
|
+
{
|
|
2722
|
+
"type": "ALIAS",
|
|
2723
|
+
"content": {
|
|
2724
|
+
"type": "SYMBOL",
|
|
2725
|
+
"name": "mlStringContinuation2"
|
|
2726
|
+
},
|
|
2727
|
+
"named": true,
|
|
2728
|
+
"value": "mlStringContinuation"
|
|
2729
|
+
},
|
|
2708
2730
|
{
|
|
2709
2731
|
"type": "ALIAS",
|
|
2710
2732
|
"content": {
|
|
@@ -2753,6 +2775,15 @@
|
|
|
2753
2775
|
"named": true,
|
|
2754
2776
|
"value": "escapeSequence"
|
|
2755
2777
|
},
|
|
2778
|
+
{
|
|
2779
|
+
"type": "ALIAS",
|
|
2780
|
+
"content": {
|
|
2781
|
+
"type": "SYMBOL",
|
|
2782
|
+
"name": "mlStringContinuation3"
|
|
2783
|
+
},
|
|
2784
|
+
"named": true,
|
|
2785
|
+
"value": "mlStringContinuation"
|
|
2786
|
+
},
|
|
2756
2787
|
{
|
|
2757
2788
|
"type": "ALIAS",
|
|
2758
2789
|
"content": {
|
|
@@ -2801,6 +2832,15 @@
|
|
|
2801
2832
|
"named": true,
|
|
2802
2833
|
"value": "escapeSequence"
|
|
2803
2834
|
},
|
|
2835
|
+
{
|
|
2836
|
+
"type": "ALIAS",
|
|
2837
|
+
"content": {
|
|
2838
|
+
"type": "SYMBOL",
|
|
2839
|
+
"name": "mlStringContinuation4"
|
|
2840
|
+
},
|
|
2841
|
+
"named": true,
|
|
2842
|
+
"value": "mlStringContinuation"
|
|
2843
|
+
},
|
|
2804
2844
|
{
|
|
2805
2845
|
"type": "ALIAS",
|
|
2806
2846
|
"content": {
|
|
@@ -2849,6 +2889,15 @@
|
|
|
2849
2889
|
"named": true,
|
|
2850
2890
|
"value": "escapeSequence"
|
|
2851
2891
|
},
|
|
2892
|
+
{
|
|
2893
|
+
"type": "ALIAS",
|
|
2894
|
+
"content": {
|
|
2895
|
+
"type": "SYMBOL",
|
|
2896
|
+
"name": "mlStringContinuation5"
|
|
2897
|
+
},
|
|
2898
|
+
"named": true,
|
|
2899
|
+
"value": "mlStringContinuation"
|
|
2900
|
+
},
|
|
2852
2901
|
{
|
|
2853
2902
|
"type": "ALIAS",
|
|
2854
2903
|
"content": {
|
|
@@ -2897,6 +2946,15 @@
|
|
|
2897
2946
|
"named": true,
|
|
2898
2947
|
"value": "escapeSequence"
|
|
2899
2948
|
},
|
|
2949
|
+
{
|
|
2950
|
+
"type": "ALIAS",
|
|
2951
|
+
"content": {
|
|
2952
|
+
"type": "SYMBOL",
|
|
2953
|
+
"name": "mlStringContinuation6"
|
|
2954
|
+
},
|
|
2955
|
+
"named": true,
|
|
2956
|
+
"value": "mlStringContinuation"
|
|
2957
|
+
},
|
|
2900
2958
|
{
|
|
2901
2959
|
"type": "ALIAS",
|
|
2902
2960
|
"content": {
|
|
@@ -3120,6 +3178,55 @@
|
|
|
3120
3178
|
]
|
|
3121
3179
|
}
|
|
3122
3180
|
},
|
|
3181
|
+
"mlStringContinuation": {
|
|
3182
|
+
"type": "IMMEDIATE_TOKEN",
|
|
3183
|
+
"content": {
|
|
3184
|
+
"type": "PATTERN",
|
|
3185
|
+
"value": "\\\\\\r?\\n"
|
|
3186
|
+
}
|
|
3187
|
+
},
|
|
3188
|
+
"mlStringContinuation1": {
|
|
3189
|
+
"type": "IMMEDIATE_TOKEN",
|
|
3190
|
+
"content": {
|
|
3191
|
+
"type": "PATTERN",
|
|
3192
|
+
"value": "\\\\#\\r?\\n"
|
|
3193
|
+
}
|
|
3194
|
+
},
|
|
3195
|
+
"mlStringContinuation2": {
|
|
3196
|
+
"type": "IMMEDIATE_TOKEN",
|
|
3197
|
+
"content": {
|
|
3198
|
+
"type": "PATTERN",
|
|
3199
|
+
"value": "\\\\##\\r?\\n"
|
|
3200
|
+
}
|
|
3201
|
+
},
|
|
3202
|
+
"mlStringContinuation3": {
|
|
3203
|
+
"type": "IMMEDIATE_TOKEN",
|
|
3204
|
+
"content": {
|
|
3205
|
+
"type": "PATTERN",
|
|
3206
|
+
"value": "\\\\###\\r?\\n"
|
|
3207
|
+
}
|
|
3208
|
+
},
|
|
3209
|
+
"mlStringContinuation4": {
|
|
3210
|
+
"type": "IMMEDIATE_TOKEN",
|
|
3211
|
+
"content": {
|
|
3212
|
+
"type": "PATTERN",
|
|
3213
|
+
"value": "\\\\####\\r?\\n"
|
|
3214
|
+
}
|
|
3215
|
+
},
|
|
3216
|
+
"mlStringContinuation5": {
|
|
3217
|
+
"type": "IMMEDIATE_TOKEN",
|
|
3218
|
+
"content": {
|
|
3219
|
+
"type": "PATTERN",
|
|
3220
|
+
"value": "\\\\#####\\r?\\n"
|
|
3221
|
+
}
|
|
3222
|
+
},
|
|
3223
|
+
"mlStringContinuation6": {
|
|
3224
|
+
"type": "IMMEDIATE_TOKEN",
|
|
3225
|
+
"content": {
|
|
3226
|
+
"type": "PATTERN",
|
|
3227
|
+
"value": "\\\\######\\r?\\n"
|
|
3228
|
+
}
|
|
3229
|
+
},
|
|
3123
3230
|
"stringInterpolation": {
|
|
3124
3231
|
"type": "SEQ",
|
|
3125
3232
|
"members": [
|
package/src/node-types.json
CHANGED
|
@@ -3430,6 +3430,10 @@
|
|
|
3430
3430
|
"type": "escapeSequence",
|
|
3431
3431
|
"named": true
|
|
3432
3432
|
},
|
|
3433
|
+
{
|
|
3434
|
+
"type": "mlStringContinuation",
|
|
3435
|
+
"named": true
|
|
3436
|
+
},
|
|
3433
3437
|
{
|
|
3434
3438
|
"type": "mlStringLiteralPart",
|
|
3435
3439
|
"named": true
|
|
@@ -8656,6 +8660,10 @@
|
|
|
8656
8660
|
"type": "local",
|
|
8657
8661
|
"named": false
|
|
8658
8662
|
},
|
|
8663
|
+
{
|
|
8664
|
+
"type": "mlStringContinuation",
|
|
8665
|
+
"named": true
|
|
8666
|
+
},
|
|
8659
8667
|
{
|
|
8660
8668
|
"type": "module",
|
|
8661
8669
|
"named": false
|