tree-sitter-compact 0.0.0-stage → 0.3.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/package.json CHANGED
@@ -1,6 +1,71 @@
1
1
  {
2
2
  "name": "tree-sitter-compact",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.0",
4
+ "description": "A zero-knowledge smart contract programming language",
5
+ "repository": "https://github.com/1NickPappas/compact-tree-sitter",
6
+ "homepage": "https://github.com/1NickPappas/compact-tree-sitter#readme",
7
+ "bugs": "https://github.com/1NickPappas/compact-tree-sitter/issues",
8
+ "license": "Apache-2.0",
9
+ "author": {
10
+ "name": "Nick Pappas",
11
+ "url": "https://github.com/1NickPappas"
12
+ },
13
+ "contributors": [
14
+ {
15
+ "name": "Lucas Rosa",
16
+ "email": "lucas.rosa@shielded.io"
17
+ }
18
+ ],
19
+ "compact": {
20
+ "language": ">=0.23.0 <=0.27.0",
21
+ "toolchain": ">=0.31.1 <=0.35.0",
22
+ "runtime": ">=0.16.0 <=0.20.0"
23
+ },
24
+ "main": "bindings/node",
25
+ "types": "bindings/node",
26
+ "keywords": [
27
+ "incremental",
28
+ "parsing",
29
+ "tree-sitter",
30
+ "compact"
31
+ ],
32
+ "files": [
33
+ "grammar.js",
34
+ "tree-sitter.json",
35
+ "binding.gyp",
36
+ "prebuilds/**",
37
+ "bindings/node/*",
38
+ "queries/*",
39
+ "src/**",
40
+ "*.wasm",
41
+ "LICENSE",
42
+ "NOTICE"
43
+ ],
44
+ "dependencies": {
45
+ "node-addon-api": "^8.5.0",
46
+ "node-gyp-build": "^4.8.4"
47
+ },
48
+ "devDependencies": {
49
+ "eslint": "^9.35.0",
50
+ "eslint-config-treesitter": "^1.0.2",
51
+ "prebuildify": "^6.0.1",
52
+ "tree-sitter-cli": "^0.26.7"
53
+ },
54
+ "peerDependencies": {
55
+ "tree-sitter": "^0.25.0"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "tree-sitter": {
59
+ "optional": true
60
+ }
61
+ },
62
+ "scripts": {
63
+ "install": "node-gyp-build",
64
+ "lint": "eslint grammar.js",
65
+ "prestart": "tree-sitter build --wasm",
66
+ "start": "tree-sitter playground",
67
+ "test": "tree-sitter test",
68
+ "generate": "tree-sitter generate",
69
+ "parse": "tree-sitter parse"
70
+ }
71
+ }
@@ -0,0 +1,132 @@
1
+ ; This file is part of compact-tree-sitter.
2
+ ; Copyright (C) 2025 Midnight Foundation
3
+ ; Modifications Copyright (C) 2025 Nick Pappas and compact-tree-sitter contributors
4
+ ; SPDX-License-Identifier: Apache-2.0
5
+ ; Licensed under the Apache License, Version 2.0 (the "License");
6
+ ; you may not use this file except in compliance with the License.
7
+ ; You may obtain a copy of the License at
8
+ ;
9
+ ; http://www.apache.org/licenses/LICENSE-2.0
10
+ ;
11
+ ; Unless required by applicable law or agreed to in writing, software
12
+ ; distributed under the License is distributed on an "AS IS" BASIS,
13
+ ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ ; See the License for the specific language governing permissions and
15
+ ; limitations under the License.
16
+
17
+ ; Comments
18
+ (comment) @comment
19
+
20
+ ; Keywords
21
+ "pragma" @keyword
22
+ "import" @keyword
23
+ "export" @keyword
24
+ "module" @keyword
25
+ "include" @keyword
26
+ "ledger" @keyword
27
+ "circuit" @keyword
28
+ "witness" @keyword
29
+ "contract" @keyword
30
+ "struct" @keyword
31
+ "enum" @keyword
32
+ "type" @keyword
33
+ "new" @keyword
34
+ "constructor" @keyword.function
35
+ (pure) @keyword.modifier
36
+ (sealed) @keyword.modifier
37
+ "prefix" @keyword.modifier
38
+ "from" @keyword.modifier
39
+ "return" @keyword.return
40
+ "if" @keyword.conditional
41
+ "else" @keyword.conditional
42
+ "for" @keyword.repeat
43
+ "of" @keyword.repeat
44
+ "assert" @keyword
45
+ "const" @keyword
46
+ "default" @keyword
47
+ "map" @keyword
48
+ "fold" @keyword
49
+ "slice" @keyword
50
+ "disclose" @keyword
51
+ "emit" @keyword
52
+ "implements" @keyword
53
+ "pad" @keyword
54
+
55
+ ; Operators
56
+ "=" @operator
57
+ "+=" @operator
58
+ "-=" @operator
59
+ (equals) @operator
60
+ (not_equals) @operator
61
+ (greater_than) @operator
62
+ (less_than) @operator
63
+ (greater_than_or_equal) @operator
64
+ (less_than_or_equal) @operator
65
+ (not) @operator
66
+ (and) @operator
67
+ (or) @operator
68
+ "+" @operator
69
+ "-" @operator
70
+ "*" @operator
71
+ ":" @operator
72
+ "." @operator
73
+ "as" @operator
74
+ "=>" @operator
75
+ "?" @operator
76
+ ".." @operator
77
+ "..." @operator
78
+
79
+ ; Identifiers
80
+ (id) @variable
81
+ (module_name) @module
82
+ (function_name) @function
83
+ (struct_name) @type
84
+ (enum_name) @type
85
+ (type_name) @type
86
+ (contract_name) @type
87
+ (tvar_name) @type.parameter
88
+
89
+ ; Types
90
+ (tref (id) @type)
91
+ "Boolean" @type.builtin
92
+ "Field" @type.builtin
93
+ "Uint" @type.builtin
94
+ "Bytes" @type.builtin
95
+ "Opaque" @type.builtin
96
+ "Vector" @type.builtin
97
+
98
+ ; Literals
99
+ (nat) @number
100
+ (str) @string
101
+ (file) @string
102
+ (version) @constant
103
+ "true" @boolean
104
+ "false" @boolean
105
+
106
+ ; Punctuation
107
+ ";" @punctuation.delimiter
108
+ "," @punctuation.delimiter
109
+ "(" @punctuation.bracket
110
+ ")" @punctuation.bracket
111
+ "[" @punctuation.bracket
112
+ "]" @punctuation.bracket
113
+ "{" @punctuation.bracket
114
+ "}" @punctuation.bracket
115
+ "<" @punctuation.bracket
116
+ ">" @punctuation.bracket
117
+
118
+ ; Declarations
119
+ (pragma (id) @property)
120
+ (import_name (id) @namespace)
121
+ (import_element (id) @namespace)
122
+ (import_element alias: (id) @namespace)
123
+ (gargs (_) @type.parameter)
124
+ (struct_named_field_initializer (id) @field)
125
+ (pattern_struct_elt (id) @field)
126
+
127
+ ; Function definitions and calls
128
+ (cdefn (function_name) @function)
129
+ (wdecl (function_name) @function)
130
+ (ecdecl_circuit (id) @function)
131
+ (fun (id) @function)
132
+ (member_access_expr member: (id) @function.method)