@gram-data/tree-sitter-gram 0.3.6 → 0.3.9
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/editors/zed/extension.toml +3 -3
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/darwin-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/linux-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/linux-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/win32-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/win32-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/src/parser.c +1 -1
- package/tree-sitter-gram.wasm +0 -0
- package/tree-sitter.json +1 -1
- package/editors/zed/languages/gram/highlights.scm +0 -111
- package/editors/zed/languages/gram/indents.scm +0 -14
- package/editors/zed/languages/gram/injections.scm +0 -29
- package/editors/zed/languages/gram/locals.scm +0 -37
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id = "gram"
|
|
2
2
|
name = "Gram Language Support"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.9"
|
|
4
4
|
schema_version = 1
|
|
5
5
|
authors = ["Gram Data Contributors"]
|
|
6
6
|
description = "Support for Gram notation - composable data patterns"
|
|
@@ -12,5 +12,5 @@ capabilities = [
|
|
|
12
12
|
|
|
13
13
|
# path = "grammars/tree-sitter-gram"
|
|
14
14
|
[grammars.gram]
|
|
15
|
-
repository = "
|
|
16
|
-
rev = "
|
|
15
|
+
repository = "file:///Users/akollegger/Developer/gram-data/tree-sitter-gram"
|
|
16
|
+
rev = "v0.3.9"
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/parser.c
CHANGED
package/tree-sitter-gram.wasm
CHANGED
|
Binary file
|
package/tree-sitter.json
CHANGED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
; Strings
|
|
2
|
-
(string_literal) @string
|
|
3
|
-
(string_content) @string
|
|
4
|
-
|
|
5
|
-
; Numbers
|
|
6
|
-
(integer) @number
|
|
7
|
-
(decimal) @number
|
|
8
|
-
(hexadecimal) @number
|
|
9
|
-
(octal) @number
|
|
10
|
-
(measurement) @number
|
|
11
|
-
|
|
12
|
-
; Boolean literals
|
|
13
|
-
(boolean_literal) @boolean
|
|
14
|
-
|
|
15
|
-
; Comment (FR-003)
|
|
16
|
-
(comment) @comment
|
|
17
|
-
|
|
18
|
-
; Tagged-string tag distinct from content (FR-002)
|
|
19
|
-
(tagged_string tag: (symbol) @attribute)
|
|
20
|
-
|
|
21
|
-
; Reference identifier: pattern_reference (FR-001)
|
|
22
|
-
(pattern_reference identifier: (_) @variable)
|
|
23
|
-
|
|
24
|
-
; Symbols and identifiers (generic; definition/reference/tag captured above)
|
|
25
|
-
(symbol) @variable
|
|
26
|
-
|
|
27
|
-
; Definition-like identifiers and labels (FR-001): @type
|
|
28
|
-
; These must come AFTER generic symbol rule to take priority
|
|
29
|
-
|
|
30
|
-
; Labels (symbols and quoted names in labels nodes)
|
|
31
|
-
(labels (symbol) @type)
|
|
32
|
-
(labels (quoted_name) @type)
|
|
33
|
-
|
|
34
|
-
; Annotation identifiers and labels
|
|
35
|
-
(identified_annotation identifier: (_) @type)
|
|
36
|
-
(identified_annotation labels: (labels (symbol) @type))
|
|
37
|
-
(identified_annotation labels: (labels (quoted_name) @type))
|
|
38
|
-
|
|
39
|
-
; Subject, node, and relationship pattern definitions (FR-001): @type
|
|
40
|
-
; subject/node subject is _subject (use wildcard _ as it may be hidden in some runtimes)
|
|
41
|
-
(subject_pattern subject: (_ identifier: (_) @type))
|
|
42
|
-
(subject_pattern subject: (_ labels: (labels (symbol) @type)))
|
|
43
|
-
(subject_pattern subject: (_ labels: (labels (quoted_name) @type)))
|
|
44
|
-
(node_pattern subject: (_ identifier: (_) @type))
|
|
45
|
-
(node_pattern subject: (_ labels: (labels (symbol) @type)))
|
|
46
|
-
(node_pattern subject: (_ labels: (labels (quoted_name) @type)))
|
|
47
|
-
(relationship_pattern left: (node_pattern subject: (_ identifier: (_) @type)))
|
|
48
|
-
(relationship_pattern left: (node_pattern subject: (_ labels: (labels (symbol) @type))))
|
|
49
|
-
(relationship_pattern left: (node_pattern subject: (_ labels: (labels (quoted_name) @type))))
|
|
50
|
-
(relationship_pattern right: (node_pattern subject: (_ identifier: (_) @type)))
|
|
51
|
-
(relationship_pattern right: (node_pattern subject: (_ labels: (labels (symbol) @type))))
|
|
52
|
-
(relationship_pattern right: (node_pattern subject: (_ labels: (labels (quoted_name) @type))))
|
|
53
|
-
; Arrow kind: subject is inside optional brackets on the arrow
|
|
54
|
-
(relationship_pattern kind: (right_arrow subject: (_ identifier: (_) @type)))
|
|
55
|
-
(relationship_pattern kind: (right_arrow subject: (_ labels: (labels (symbol) @type))))
|
|
56
|
-
(relationship_pattern kind: (right_arrow subject: (_ labels: (labels (quoted_name) @type))))
|
|
57
|
-
(relationship_pattern kind: (left_arrow subject: (_ identifier: (_) @type)))
|
|
58
|
-
(relationship_pattern kind: (left_arrow subject: (_ labels: (labels (symbol) @type))))
|
|
59
|
-
(relationship_pattern kind: (left_arrow subject: (_ labels: (labels (quoted_name) @type))))
|
|
60
|
-
(relationship_pattern kind: (undirected_arrow subject: (_ identifier: (_) @type)))
|
|
61
|
-
(relationship_pattern kind: (undirected_arrow subject: (_ labels: (labels (symbol) @type))))
|
|
62
|
-
(relationship_pattern kind: (undirected_arrow subject: (_ labels: (labels (quoted_name) @type))))
|
|
63
|
-
(relationship_pattern kind: (bidirectional_arrow subject: (_ identifier: (_) @type)))
|
|
64
|
-
(relationship_pattern kind: (bidirectional_arrow subject: (_ labels: (labels (symbol) @type))))
|
|
65
|
-
(relationship_pattern kind: (bidirectional_arrow subject: (_ labels: (labels (quoted_name) @type))))
|
|
66
|
-
|
|
67
|
-
; Keywords and operators
|
|
68
|
-
[
|
|
69
|
-
"@"
|
|
70
|
-
"|"
|
|
71
|
-
":"
|
|
72
|
-
"::"
|
|
73
|
-
] @operator
|
|
74
|
-
|
|
75
|
-
; Subject Patterns and delimiters
|
|
76
|
-
[
|
|
77
|
-
"["
|
|
78
|
-
"]"
|
|
79
|
-
"("
|
|
80
|
-
")"
|
|
81
|
-
"{"
|
|
82
|
-
"}"
|
|
83
|
-
] @punctuation.bracket
|
|
84
|
-
|
|
85
|
-
; Comma separator
|
|
86
|
-
[
|
|
87
|
-
","
|
|
88
|
-
] @punctuation.delimiter
|
|
89
|
-
|
|
90
|
-
; Field names in records and maps
|
|
91
|
-
(record_property key: (symbol) @property)
|
|
92
|
-
(record_property key: (quoted_name) @property)
|
|
93
|
-
(record_property key: (double_quoted_name) @property)
|
|
94
|
-
(map_entry key: (symbol) @property)
|
|
95
|
-
(map_entry key: (quoted_name) @property)
|
|
96
|
-
(map_entry key: (double_quoted_name) @property)
|
|
97
|
-
|
|
98
|
-
; Annotation keys (property-style) and headers (identified/label-style)
|
|
99
|
-
(property_annotation key: (symbol) @attribute)
|
|
100
|
-
|
|
101
|
-
; Relationship arrows (special highlighting for graph syntax)
|
|
102
|
-
(relationship_pattern) @keyword
|
|
103
|
-
|
|
104
|
-
; Arrow operators in relationships
|
|
105
|
-
(right_arrow) @operator
|
|
106
|
-
(left_arrow) @operator
|
|
107
|
-
(undirected_arrow) @operator
|
|
108
|
-
(bidirectional_arrow) @operator
|
|
109
|
-
|
|
110
|
-
; Error highlighting
|
|
111
|
-
(ERROR) @error
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
; Indentation: 2 spaces per level for brackets and multi-line structures
|
|
2
|
-
; FR-007 — specs/004-editor-improvements/contracts/indents.md
|
|
3
|
-
|
|
4
|
-
; Record {}
|
|
5
|
-
"{" @indent
|
|
6
|
-
"}" @indent.end
|
|
7
|
-
|
|
8
|
-
; Subject pattern []
|
|
9
|
-
"[" @indent
|
|
10
|
-
"]" @indent.end
|
|
11
|
-
|
|
12
|
-
; Node pattern ()
|
|
13
|
-
"(" @indent
|
|
14
|
-
")" @indent.end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
; Language injection for tagged strings: tag`content` and ```tag\ncontent\n```
|
|
2
|
-
;
|
|
3
|
-
; The tag symbol is used as the injection language so that downstream and editors
|
|
4
|
-
; can support arbitrary tags without changing the grammar. Well-known tags (md, ts,
|
|
5
|
-
; date, datetime, time, sql, json, html, etc.) are documented in docs/tagged-strings-and-injections.md.
|
|
6
|
-
;
|
|
7
|
-
; Overrides below map tags that do not match common parser names. The final
|
|
8
|
-
; rule uses the tag's text as the language name for all other tags (e.g. "sql",
|
|
9
|
-
; "json", "html" often match parser names).
|
|
10
|
-
|
|
11
|
-
; md -> markdown
|
|
12
|
-
(tagged_string
|
|
13
|
-
tag: (symbol) @_tag
|
|
14
|
-
content: (string_content) @injection.content)
|
|
15
|
-
(#eq? @_tag "md")
|
|
16
|
-
(#set! injection.language "markdown")
|
|
17
|
-
|
|
18
|
-
; ts -> typescript
|
|
19
|
-
(tagged_string
|
|
20
|
-
tag: (symbol) @_tag
|
|
21
|
-
content: (string_content) @injection.content)
|
|
22
|
-
(#eq? @_tag "ts")
|
|
23
|
-
(#set! injection.language "typescript")
|
|
24
|
-
|
|
25
|
-
; Dynamic: use tag text as language name for all other tags (sql, json, html, etc.)
|
|
26
|
-
; Editors may map additional tags (e.g. date, datetime, time) to parsers or leave as plain.
|
|
27
|
-
(tagged_string
|
|
28
|
-
tag: (symbol) @injection.language
|
|
29
|
-
content: (string_content) @injection.content)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
; Locals: go to definition and highlight references (file scope)
|
|
2
|
-
; FR-005, FR-006 — specs/004-editor-improvements/contracts/locals.md
|
|
3
|
-
|
|
4
|
-
; File scope: all definitions and references in one scope
|
|
5
|
-
(gram_pattern) @local.scope
|
|
6
|
-
|
|
7
|
-
; Definitions: identifiers that define a pattern or annotation
|
|
8
|
-
(subject_pattern subject: (_ identifier: (_) @local.definition))
|
|
9
|
-
(subject_pattern subject: (_ labels: (labels (symbol) @local.definition)))
|
|
10
|
-
(subject_pattern subject: (_ labels: (labels (quoted_name) @local.definition)))
|
|
11
|
-
(node_pattern subject: (_ identifier: (_) @local.definition))
|
|
12
|
-
(node_pattern subject: (_ labels: (labels (symbol) @local.definition)))
|
|
13
|
-
(node_pattern subject: (_ labels: (labels (quoted_name) @local.definition)))
|
|
14
|
-
(relationship_pattern left: (node_pattern subject: (_ identifier: (_) @local.definition)))
|
|
15
|
-
(relationship_pattern left: (node_pattern subject: (_ labels: (labels (symbol) @local.definition))))
|
|
16
|
-
(relationship_pattern left: (node_pattern subject: (_ labels: (labels (quoted_name) @local.definition))))
|
|
17
|
-
(relationship_pattern right: (node_pattern subject: (_ identifier: (_) @local.definition)))
|
|
18
|
-
(relationship_pattern right: (node_pattern subject: (_ labels: (labels (symbol) @local.definition))))
|
|
19
|
-
(relationship_pattern right: (node_pattern subject: (_ labels: (labels (quoted_name) @local.definition))))
|
|
20
|
-
(relationship_pattern kind: (right_arrow subject: (_ identifier: (_) @local.definition)))
|
|
21
|
-
(relationship_pattern kind: (right_arrow subject: (_ labels: (labels (symbol) @local.definition))))
|
|
22
|
-
(relationship_pattern kind: (right_arrow subject: (_ labels: (labels (quoted_name) @local.definition))))
|
|
23
|
-
(relationship_pattern kind: (left_arrow subject: (_ identifier: (_) @local.definition)))
|
|
24
|
-
(relationship_pattern kind: (left_arrow subject: (_ labels: (labels (symbol) @local.definition))))
|
|
25
|
-
(relationship_pattern kind: (left_arrow subject: (_ labels: (labels (quoted_name) @local.definition))))
|
|
26
|
-
(relationship_pattern kind: (undirected_arrow subject: (_ identifier: (_) @local.definition)))
|
|
27
|
-
(relationship_pattern kind: (undirected_arrow subject: (_ labels: (labels (symbol) @local.definition))))
|
|
28
|
-
(relationship_pattern kind: (undirected_arrow subject: (_ labels: (labels (quoted_name) @local.definition))))
|
|
29
|
-
(relationship_pattern kind: (bidirectional_arrow subject: (_ identifier: (_) @local.definition)))
|
|
30
|
-
(relationship_pattern kind: (bidirectional_arrow subject: (_ labels: (labels (symbol) @local.definition))))
|
|
31
|
-
(relationship_pattern kind: (bidirectional_arrow subject: (_ labels: (labels (quoted_name) @local.definition))))
|
|
32
|
-
(identified_annotation identifier: (_) @local.definition)
|
|
33
|
-
(identified_annotation labels: (labels (symbol) @local.definition))
|
|
34
|
-
(identified_annotation labels: (labels (quoted_name) @local.definition))
|
|
35
|
-
|
|
36
|
-
; References: pattern_reference identifier
|
|
37
|
-
(pattern_reference identifier: (_) @local.reference)
|