@willbooster/tree-sitter-c 0.0.0-placeholder.0 → 1.0.1

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,13 +1,74 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-c",
3
- "version": "0.0.0-placeholder.0",
4
- "description": "Placeholder for WillBooster's fork of tree-sitter-c; the first release is 1.0.0",
3
+ "version": "1.0.1",
4
+ "description": "C grammar for tree-sitter",
5
+ "keywords": [
6
+ "incremental",
7
+ "parsing",
8
+ "tree-sitter",
9
+ "c"
10
+ ],
5
11
  "repository": {
6
12
  "type": "git",
7
13
  "url": "git+https://github.com/WillBooster/tree-sitter-c.git"
8
14
  },
9
15
  "license": "MIT",
10
16
  "author": "WillBooster Inc.",
17
+ "files": [
18
+ "grammar.js",
19
+ "queries/*.scm",
20
+ "src/node-types.json",
21
+ "tree-sitter.json",
22
+ "*.wasm"
23
+ ],
24
+ "scripts": {
25
+ "build-wasm": "tree-sitter build --wasm",
26
+ "build/ci": "tree-sitter generate && tree-sitter build --wasm",
27
+ "cleanup": "bun wb lint --fix --format",
28
+ "format": "bun wb lint --format",
29
+ "lint": "bun wb lint",
30
+ "lint-fix": "bun wb lint --fix",
31
+ "prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
32
+ "release": "wb release",
33
+ "prestart": "bun run build-wasm",
34
+ "start": "tree-sitter playground",
35
+ "test": "bun wb test",
36
+ "test/ci": "bun wb test-on-ci",
37
+ "test/ci-setup": "playwright install --with-deps chromium",
38
+ "typecheck": "bun wb typecheck",
39
+ "verify": "bun wb verify",
40
+ "verify-full": "bun wb verify --full"
41
+ },
42
+ "devDependencies": {
43
+ "@semantic-release/exec": "7.1.0",
44
+ "@tsconfig/bun": "1.0.11",
45
+ "@types/bun": "1.4.2",
46
+ "@vitest/browser-playwright": "5.0.1",
47
+ "@willbooster/oxfmt-config": "1.2.2",
48
+ "@willbooster/oxlint-config": "1.4.8",
49
+ "@willbooster/wb": "22.11.5",
50
+ "@willbooster/web-tree-sitter": "1.0.0",
51
+ "conventional-changelog-conventionalcommits": "10.4.0",
52
+ "lefthook": "2.1.14",
53
+ "oxfmt": "0.70.0",
54
+ "oxlint": "1.85.0",
55
+ "oxlint-tsgolint": "7.0.2002",
56
+ "playwright": "1.63.0",
57
+ "semantic-release": "25.0.9",
58
+ "sort-package-json": "4.0.0",
59
+ "tree-sitter-cli": "0.27.0",
60
+ "typescript": "7.0.2",
61
+ "vitest": "5.0.1",
62
+ "wrangler": "4.136.1"
63
+ },
64
+ "peerDependencies": {
65
+ "@willbooster/web-tree-sitter": "^1.0.0"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "@willbooster/web-tree-sitter": {
69
+ "optional": true
70
+ }
71
+ },
11
72
  "publishConfig": {
12
73
  "access": "public",
13
74
  "registry": "https://registry.npmjs.org/"
@@ -0,0 +1,81 @@
1
+ (identifier) @variable
2
+
3
+ ((identifier) @constant
4
+ (#match? @constant "^[A-Z][A-Z\\d_]*$"))
5
+
6
+ "break" @keyword
7
+ "case" @keyword
8
+ "const" @keyword
9
+ "continue" @keyword
10
+ "default" @keyword
11
+ "do" @keyword
12
+ "else" @keyword
13
+ "enum" @keyword
14
+ "extern" @keyword
15
+ "for" @keyword
16
+ "if" @keyword
17
+ "inline" @keyword
18
+ "return" @keyword
19
+ "sizeof" @keyword
20
+ "static" @keyword
21
+ "struct" @keyword
22
+ "switch" @keyword
23
+ "typedef" @keyword
24
+ "union" @keyword
25
+ "volatile" @keyword
26
+ "while" @keyword
27
+
28
+ "#define" @keyword
29
+ "#elif" @keyword
30
+ "#else" @keyword
31
+ "#endif" @keyword
32
+ "#if" @keyword
33
+ "#ifdef" @keyword
34
+ "#ifndef" @keyword
35
+ "#include" @keyword
36
+ (preproc_directive) @keyword
37
+
38
+ "--" @operator
39
+ "-" @operator
40
+ "-=" @operator
41
+ "->" @operator
42
+ "=" @operator
43
+ "!=" @operator
44
+ "*" @operator
45
+ "&" @operator
46
+ "&&" @operator
47
+ "+" @operator
48
+ "++" @operator
49
+ "+=" @operator
50
+ "<" @operator
51
+ "==" @operator
52
+ ">" @operator
53
+ "||" @operator
54
+
55
+ "." @delimiter
56
+ ";" @delimiter
57
+
58
+ (string_literal) @string
59
+ (system_lib_string) @string
60
+
61
+ (null) @constant
62
+ (number_literal) @number
63
+ (char_literal) @number
64
+
65
+ (field_identifier) @property
66
+ (statement_identifier) @label
67
+ (type_identifier) @type
68
+ (primitive_type) @type
69
+ (sized_type_specifier) @type
70
+
71
+ (call_expression
72
+ function: (identifier) @function)
73
+ (call_expression
74
+ function: (field_expression
75
+ field: (field_identifier) @function))
76
+ (function_declarator
77
+ declarator: (identifier) @function)
78
+ (preproc_function_def
79
+ name: (identifier) @function.special)
80
+
81
+ (comment) @comment
@@ -0,0 +1,9 @@
1
+ (struct_specifier name: (type_identifier) @name body:(_)) @definition.class
2
+
3
+ (declaration type: (union_specifier name: (type_identifier) @name)) @definition.class
4
+
5
+ (function_declarator declarator: (identifier) @name) @definition.function
6
+
7
+ (type_definition declarator: (type_identifier) @name) @definition.type
8
+
9
+ (enum_specifier name: (type_identifier) @name) @definition.type