@apple/tree-sitter-pkl 0.16.0 → 0.17.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/CHANGELOG.adoc +40 -0
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/Package.swift +24 -0
- package/README.md +42 -0
- package/bindings/c/tree-sitter-pkl.h +16 -0
- package/bindings/swift/TreeSitterPkl/pkl.h +16 -0
- package/grammar.js +147 -63
- package/package.json +3 -4
- package/queries/highlights.scm +3 -8
- package/queries/injections.scm +3 -3
- package/src/grammar.json +750 -353
- package/src/node-types.json +1768 -1043
- package/src/parser.c +45772 -50670
- package/src/scanner.c +60 -28
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +290 -0
- package/src/tree_sitter/parser.h +54 -13
- package/test/corpus/basic/annotation.txt +243 -0
- package/test/corpus/basic/comments.txt +41 -0
- package/test/corpus/basic/shebangComment.txt +15 -0
- package/test/corpus/basic/types.txt +232 -0
- package/test/corpus/class/constModifier.txt +24 -0
- package/test/corpus/class/fixedModifier.txt +24 -0
- package/test/corpus/expr/binary.txt +109 -0
- package/test/corpus/expr/functionLiteral.txt +23 -0
- package/test/corpus/expr/if.txt +15 -0
- package/test/corpus/expr/import.txt +20 -0
- package/test/corpus/expr/let.txt +17 -0
- package/test/corpus/expr/new.txt +36 -0
- package/test/corpus/expr/qualifiedAccess.txt +95 -0
- package/test/corpus/expr/read.txt +29 -0
- package/test/corpus/expr/throw.txt +14 -0
- package/test/corpus/expr/trace.txt +14 -0
- package/test/corpus/module/moduleHeader1.txt +23 -0
- package/test/corpus/module/moduleHeader2.txt +29 -0
- package/test/corpus/module/moduleHeader3.error.txt +23 -0
- package/test/corpus/module/moduleHeader4.txt +34 -0
- package/test/corpus/module/moduleHeader5.txt +16 -0
- package/test/corpus/module/moduleHeader6.txt +17 -0
- package/test/corpus/number/underscores.txt +99 -0
- package/test/corpus/object/objectAmendChain.txt +38 -0
- package/test/corpus/object/objectElementsWithParens.txt +51 -0
- package/test/corpus/object/objectGenerator.txt +53 -0
- package/test/corpus/object/objectMember.txt +129 -0
- package/test/corpus/object/objectMemberPredicate.txt +41 -0
- package/test/corpus/object/objectSpread.txt +51 -0
- package/test/corpus/object/objectWhenGenerator.txt +71 -0
- package/test/corpus/string/customStringDelimiters.txt +397 -0
- package/test/corpus/string/missingDelimiter.txt +28 -0
- package/test/corpus/string/multiline.txt +39 -0
- package/test/corpus/string/multilineInterpolation.txt +102 -0
- package/test/corpus/string/simple.txt +13 -0
- package/test/corpus/string/singleLineEscapes.txt +64 -0
- package/test/corpus/string/singleLineInterpolation.txt +94 -0
- package/test/corpus/string/stringWithTwoSlashes.txt +20 -0
- package/README.adoc +0 -61
- package/src/synctests.ts +0 -44
package/queries/highlights.scm
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
(clazz (identifier) @type)
|
|
4
4
|
(typeAlias (identifier) @type)
|
|
5
5
|
((identifier) @type
|
|
6
|
-
(match? @type "^[A-Z]"))
|
|
6
|
+
(#match? @type "^[A-Z]"))
|
|
7
7
|
|
|
8
8
|
(typeArgumentList
|
|
9
9
|
"<" @punctuation.bracket
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
(lineComment) @comment
|
|
56
56
|
(blockComment) @comment
|
|
57
57
|
(docComment) @comment
|
|
58
|
+
(shebangComment) @comment
|
|
58
59
|
|
|
59
60
|
; Operators
|
|
60
61
|
|
|
@@ -79,10 +80,6 @@
|
|
|
79
80
|
"%" @operator
|
|
80
81
|
"|>" @operator
|
|
81
82
|
|
|
82
|
-
"?" @operator.type
|
|
83
|
-
"|" @operator.type
|
|
84
|
-
"->" @operator.type
|
|
85
|
-
|
|
86
83
|
"," @punctuation.delimiter
|
|
87
84
|
":" @punctuation.delimiter
|
|
88
85
|
"." @punctuation.delimiter
|
|
@@ -90,7 +87,7 @@
|
|
|
90
87
|
|
|
91
88
|
"(" @punctuation.bracket
|
|
92
89
|
")" @punctuation.bracket
|
|
93
|
-
|
|
90
|
+
"[" @punctuation.bracket
|
|
94
91
|
"]" @punctuation.bracket
|
|
95
92
|
"{" @punctuation.bracket
|
|
96
93
|
"}" @punctuation.bracket
|
|
@@ -120,7 +117,6 @@
|
|
|
120
117
|
(moduleExpr "module" @type.builtin)
|
|
121
118
|
"module" @keyword
|
|
122
119
|
"new" @keyword
|
|
123
|
-
"nothing" @type.builtin
|
|
124
120
|
(nullLiteral) @constant.builtin
|
|
125
121
|
"open" @keyword
|
|
126
122
|
"out" @keyword
|
|
@@ -134,5 +130,4 @@
|
|
|
134
130
|
"trace" @function.method.builtin
|
|
135
131
|
(trueLiteral) @constant.builtin
|
|
136
132
|
"typealias" @keyword
|
|
137
|
-
"unknown" @type.builtin
|
|
138
133
|
"when" @keyword
|
package/queries/injections.scm
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
; * string delimiters are considered part of the regex
|
|
4
4
|
(
|
|
5
5
|
((methodCallExpr (identifier) @methodName (argumentList (slStringLiteral) @injection.content))
|
|
6
|
-
(set! injection.language "regex"))
|
|
7
|
-
(eq? @methodName "Regex"))
|
|
6
|
+
(#set! injection.language "regex"))
|
|
7
|
+
(#eq? @methodName "Regex"))
|
|
8
8
|
|
|
9
|
-
; TODO: inject markdown into doc comments
|
|
9
|
+
; TODO: inject markdown into doc comments
|