@mermanjs/tree-sitter-mermaid 0.3.3 → 0.3.4
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.md +5 -0
- package/CMakeLists.txt +1 -1
- package/Makefile +1 -1
- package/README.md +6 -6
- package/grammar/families/class.js +4 -2
- package/grammar.js +1 -0
- package/metadata/derivations.json +19 -0
- package/metadata/provenance.json +1 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/darwin-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/linux-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/win32-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/src/grammar.json +46 -0
- package/src/parser.c +167219 -167134
- package/src/scanner.c +50 -0
- package/tree-sitter-mermaid.wasm +0 -0
- package/tree-sitter.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.4 - 2026-11-12
|
|
4
|
+
|
|
5
|
+
- Keep generic suffixes attached to backtick-quoted Class names in declarations and compact relationship endpoints.
|
|
6
|
+
- Recognize compact Class relationship operators without consuming their hyphens or dots as part of the source name. Ordinary and trailing hyphens remain valid in class names.
|
|
7
|
+
|
|
3
8
|
## 0.3.3 - 2026-11-06
|
|
4
9
|
|
|
5
10
|
- Refresh the npm development-tool lockfile to semver 7.8.6 and undici 8.12.4.
|
package/CMakeLists.txt
CHANGED
package/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -29,8 +29,8 @@ The grammar has its own version line, independent of Merman. Its npm and Cargo a
|
|
|
29
29
|
grammar version, but their registry names differ: the npm package is scoped under `@mermanjs`, while
|
|
30
30
|
the Rust crate and C library retain the standard `tree-sitter-mermaid` name.
|
|
31
31
|
|
|
32
|
-
This guide targets `0.3.
|
|
33
|
-
|
|
32
|
+
This guide targets `0.3.4`. The patch keeps generic suffixes attached to quoted Class names and recognizes compact Class relationship operators without consuming them as part of a class name. Check the [independent publication record](https://github.com/Latias94/merman/blob/main/docs/release/PUBLISH_ORDER.md#0100-preparation) for verified registry availability.
|
|
33
|
+
Portable queries, Mermaid/ZenUML baselines, language ABI 15, runtime versions, and the Rust
|
|
34
34
|
`cc` minimum of `1.10.0` remain unchanged. See [CHANGELOG.md](CHANGELOG.md) for package changes.
|
|
35
35
|
Match the examples to the version installed in your project; earlier versions have their own tagged
|
|
36
36
|
documentation. Custom query consumers should review the
|
|
@@ -39,7 +39,7 @@ documentation. Custom query consumers should review the
|
|
|
39
39
|
## Node.js
|
|
40
40
|
|
|
41
41
|
```console
|
|
42
|
-
npm install tree-sitter@0.25.1 @mermanjs/tree-sitter-mermaid@0.3.
|
|
42
|
+
npm install tree-sitter@0.25.1 @mermanjs/tree-sitter-mermaid@0.3.4
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
With npm 12 or later, review and approve the native install scripts, then rebuild:
|
|
@@ -76,7 +76,7 @@ import Mermaid from '@mermanjs/tree-sitter-mermaid';
|
|
|
76
76
|
## Browser and Workers
|
|
77
77
|
|
|
78
78
|
```console
|
|
79
|
-
npm install web-tree-sitter@0.27.1 @mermanjs/tree-sitter-mermaid@0.3.
|
|
79
|
+
npm install web-tree-sitter@0.27.1 @mermanjs/tree-sitter-mermaid@0.3.4
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
The package exports `@mermanjs/tree-sitter-mermaid/tree-sitter-mermaid.wasm`. Copy that asset to a
|
|
@@ -97,7 +97,7 @@ A no-build browser prototype can pin the exact grammar version on jsDelivr:
|
|
|
97
97
|
|
|
98
98
|
```js
|
|
99
99
|
const language = await Language.load(
|
|
100
|
-
'https://cdn.jsdelivr.net/npm/@mermanjs/tree-sitter-mermaid@0.3.
|
|
100
|
+
'https://cdn.jsdelivr.net/npm/@mermanjs/tree-sitter-mermaid@0.3.4/tree-sitter-mermaid.wasm',
|
|
101
101
|
);
|
|
102
102
|
```
|
|
103
103
|
|
|
@@ -151,7 +151,7 @@ int main(void) {
|
|
|
151
151
|
}
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
Version 0.3.4 pairs with Tree-sitter CLI, Rust, and Web runtime 0.27.1; the Rust language adapter uses compatible `^0.1.9`, and the generated language ABI remains 15. See [query migration](docs/query-migration.md) when upgrading queries and the [grammar release guide](../../docs/release/TREE_SITTER_MERMAID.md) when maintaining the package.
|
|
155
155
|
|
|
156
156
|
## Compatibility
|
|
157
157
|
|
|
@@ -403,8 +403,9 @@ const classRules = {
|
|
|
403
403
|
|
|
404
404
|
_class_identifier: ($) => choice(
|
|
405
405
|
$.identifier,
|
|
406
|
+
alias($._class_compact_identifier, $.identifier),
|
|
406
407
|
token(prec(5, choice(
|
|
407
|
-
seq('`', /[^`]+/, '`'),
|
|
408
|
+
seq('`', /[^`]+/, '`', optional(/~[^~\r\n]+~/)),
|
|
408
409
|
/[0-9][A-Za-z0-9_.\-\u00c0-\uffff]*(?:~[^~\r\n]+~)?/,
|
|
409
410
|
/[A-Za-z_\u00c0-\uffff][A-Za-z0-9_\-\u00c0-\uffff]*\.[A-Za-z0-9_.\-\u00c0-\uffff]+(?:~[^~\r\n]+~)?/,
|
|
410
411
|
/[A-Za-z_\u00c0-\uffff][A-Za-z0-9_.\-\u00c0-\uffff]*~[^~\r\n]+~/,
|
|
@@ -416,8 +417,9 @@ const classRules = {
|
|
|
416
417
|
token.immediate(/[A-Za-z_\u00c0-\uffff][A-Za-z0-9_\-\u00c0-\uffff]*/),
|
|
417
418
|
$.identifier,
|
|
418
419
|
),
|
|
420
|
+
alias($._class_compact_identifier, $.identifier),
|
|
419
421
|
token.immediate(prec(5, choice(
|
|
420
|
-
seq('`', /[^`]+/, '`'),
|
|
422
|
+
seq('`', /[^`]+/, '`', optional(/~[^~\r\n]+~/)),
|
|
421
423
|
/[0-9][A-Za-z0-9_.\-\u00c0-\uffff]*(?:~[^~\r\n]+~)?/,
|
|
422
424
|
/[A-Za-z_\u00c0-\uffff][A-Za-z0-9_\-\u00c0-\uffff]*\.[A-Za-z0-9_.\-\u00c0-\uffff]+(?:~[^~\r\n]+~)?/,
|
|
423
425
|
/[A-Za-z_\u00c0-\uffff][A-Za-z0-9_.\-\u00c0-\uffff]*~[^~\r\n]+~/,
|
package/grammar.js
CHANGED
|
@@ -461,6 +461,25 @@
|
|
|
461
461
|
}
|
|
462
462
|
]
|
|
463
463
|
},
|
|
464
|
+
{
|
|
465
|
+
"localPaths": [
|
|
466
|
+
"src/scanner.c",
|
|
467
|
+
"grammar/families/class.js"
|
|
468
|
+
],
|
|
469
|
+
"localSymbols": [
|
|
470
|
+
"scan_class_compact_identifier",
|
|
471
|
+
"_class_compact_identifier"
|
|
472
|
+
],
|
|
473
|
+
"sources": [
|
|
474
|
+
{
|
|
475
|
+
"sourceId": "mermaid",
|
|
476
|
+
"relationship": "translated",
|
|
477
|
+
"sourcePaths": [
|
|
478
|
+
"packages/mermaid/src/diagrams/class/parser/classDiagram.jison:1-440"
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
},
|
|
464
483
|
{
|
|
465
484
|
"localPaths": [
|
|
466
485
|
"src/scanner.c",
|
package/metadata/provenance.json
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/grammar.json
CHANGED
|
@@ -10785,6 +10785,15 @@
|
|
|
10785
10785
|
"type": "SYMBOL",
|
|
10786
10786
|
"name": "identifier"
|
|
10787
10787
|
},
|
|
10788
|
+
{
|
|
10789
|
+
"type": "ALIAS",
|
|
10790
|
+
"content": {
|
|
10791
|
+
"type": "SYMBOL",
|
|
10792
|
+
"name": "_class_compact_identifier"
|
|
10793
|
+
},
|
|
10794
|
+
"named": true,
|
|
10795
|
+
"value": "identifier"
|
|
10796
|
+
},
|
|
10788
10797
|
{
|
|
10789
10798
|
"type": "TOKEN",
|
|
10790
10799
|
"content": {
|
|
@@ -10807,6 +10816,18 @@
|
|
|
10807
10816
|
{
|
|
10808
10817
|
"type": "STRING",
|
|
10809
10818
|
"value": "`"
|
|
10819
|
+
},
|
|
10820
|
+
{
|
|
10821
|
+
"type": "CHOICE",
|
|
10822
|
+
"members": [
|
|
10823
|
+
{
|
|
10824
|
+
"type": "PATTERN",
|
|
10825
|
+
"value": "~[^~\\r\\n]+~"
|
|
10826
|
+
},
|
|
10827
|
+
{
|
|
10828
|
+
"type": "BLANK"
|
|
10829
|
+
}
|
|
10830
|
+
]
|
|
10810
10831
|
}
|
|
10811
10832
|
]
|
|
10812
10833
|
},
|
|
@@ -10843,6 +10864,15 @@
|
|
|
10843
10864
|
"named": true,
|
|
10844
10865
|
"value": "identifier"
|
|
10845
10866
|
},
|
|
10867
|
+
{
|
|
10868
|
+
"type": "ALIAS",
|
|
10869
|
+
"content": {
|
|
10870
|
+
"type": "SYMBOL",
|
|
10871
|
+
"name": "_class_compact_identifier"
|
|
10872
|
+
},
|
|
10873
|
+
"named": true,
|
|
10874
|
+
"value": "identifier"
|
|
10875
|
+
},
|
|
10846
10876
|
{
|
|
10847
10877
|
"type": "IMMEDIATE_TOKEN",
|
|
10848
10878
|
"content": {
|
|
@@ -10865,6 +10895,18 @@
|
|
|
10865
10895
|
{
|
|
10866
10896
|
"type": "STRING",
|
|
10867
10897
|
"value": "`"
|
|
10898
|
+
},
|
|
10899
|
+
{
|
|
10900
|
+
"type": "CHOICE",
|
|
10901
|
+
"members": [
|
|
10902
|
+
{
|
|
10903
|
+
"type": "PATTERN",
|
|
10904
|
+
"value": "~[^~\\r\\n]+~"
|
|
10905
|
+
},
|
|
10906
|
+
{
|
|
10907
|
+
"type": "BLANK"
|
|
10908
|
+
}
|
|
10909
|
+
]
|
|
10868
10910
|
}
|
|
10869
10911
|
]
|
|
10870
10912
|
},
|
|
@@ -77819,6 +77861,10 @@
|
|
|
77819
77861
|
{
|
|
77820
77862
|
"type": "SYMBOL",
|
|
77821
77863
|
"name": "_directive_body"
|
|
77864
|
+
},
|
|
77865
|
+
{
|
|
77866
|
+
"type": "SYMBOL",
|
|
77867
|
+
"name": "_class_compact_identifier"
|
|
77822
77868
|
}
|
|
77823
77869
|
],
|
|
77824
77870
|
"inline": [],
|