@lumis-sh/wasm-carve 0.0.0-stage → 0.26.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/LICENSE +21 -0
- package/README.md +51 -2
- package/index.d.ts +28 -0
- package/index.edge.js +15 -0
- package/index.js +15 -0
- package/index.workerd.js +15 -0
- package/language-package.js +22 -0
- package/lumis.json +22 -0
- package/package.json +36 -4
- package/tree-sitter-carve.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Leandro Pereira
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @lumis-sh/wasm-carve
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Self-contained Lumis language package for carve.
|
|
4
|
+
|
|
5
|
+
The Tree-sitter parser is compiled to WASM and ships with the queries that highlight it.
|
|
6
|
+
|
|
7
|
+
Built with [`tree-sitter build --wasm`](https://tree-sitter.github.io/tree-sitter/cli/build.html) `v0.26.11`
|
|
8
|
+
|
|
9
|
+
Used by [Lumis](https://lumis.sh) and compatible with [web-tree-sitter](https://www.npmjs.com/package/web-tree-sitter) v0.26 and other WASM runtimes.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @lumis-sh/wasm-carve
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
The package exports the language, ready for Lumis, in Node and in a browser:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import { createHighlighter } from '@lumis-sh/lumis'
|
|
23
|
+
import carve from '@lumis-sh/wasm-carve'
|
|
24
|
+
|
|
25
|
+
const highlighter = await createHighlighter({ languages: [carve] })
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## What it contains
|
|
29
|
+
|
|
30
|
+
`tree-sitter-carve.wasm` is the parser. `lumis.json` describes it and records its size, its SHA-256 and the queries.
|
|
31
|
+
|
|
32
|
+
Node reads both from the installed package, and a bundler ships them with your code, so nothing is downloaded at runtime.
|
|
33
|
+
|
|
34
|
+
## Parser
|
|
35
|
+
|
|
36
|
+
| Parser | Version | Rev |
|
|
37
|
+
| ------ | ------- | --- |
|
|
38
|
+
| [https://github.com/markup-carve/tree-sitter-carve.git](https://github.com/markup-carve/tree-sitter-carve.git) | 0.1.14 | 0f2eb839f7810151e2f1a6b1ed9400ef5c5c643d |
|
|
39
|
+
|
|
40
|
+
The same parser is published to Hex as
|
|
41
|
+
[`lumis_wasm_carve`](https://hex.pm/packages/lumis_wasm_carve) — byte for byte, from
|
|
42
|
+
one build, so both registries serve the same artifact.
|
|
43
|
+
|
|
44
|
+
## CDN
|
|
45
|
+
|
|
46
|
+
- [https://unpkg.com/@lumis-sh/wasm-carve@0.26.0/tree-sitter-carve.wasm](https://unpkg.com/@lumis-sh/wasm-carve@0.26.0/tree-sitter-carve.wasm)
|
|
47
|
+
- [https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-carve@0.26.0/tree-sitter-carve.wasm](https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-carve@0.26.0/tree-sitter-carve.wasm)
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
The Lumis packaging is MIT. The parser itself is redistributed from the
|
|
52
|
+
upstream project above; see that project for its license.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A language from this package. Pass it to `createHighlighter({ languages })`
|
|
3
|
+
* from `@lumis-sh/lumis`, in Node or in a browser.
|
|
4
|
+
*/
|
|
5
|
+
export interface Language {
|
|
6
|
+
id: string
|
|
7
|
+
aliases: string[]
|
|
8
|
+
packageName: string
|
|
9
|
+
/**
|
|
10
|
+
* The parser, which a bundler ships next to your code: a `URL`, or a
|
|
11
|
+
* `WebAssembly.Module` on Cloudflare Workers and Vercel's Edge runtime.
|
|
12
|
+
*/
|
|
13
|
+
wasm: URL | WebAssembly.Module
|
|
14
|
+
languagePackage: LanguagePackage
|
|
15
|
+
/** Grammars this language cannot highlight without, loaded along with it. */
|
|
16
|
+
requires?: Language[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** This package's `lumis.json`: the parser's digest, and the queries released with it. */
|
|
20
|
+
export interface LanguagePackage {
|
|
21
|
+
packageName: string
|
|
22
|
+
version: string
|
|
23
|
+
[field: string]: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare const languagePackage: LanguagePackage
|
|
27
|
+
export declare const carve: Language
|
|
28
|
+
export { carve as default }
|
package/index.edge.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { languagePackage } from './language-package.js'
|
|
2
|
+
|
|
3
|
+
import wasm from './tree-sitter-carve.wasm?module'
|
|
4
|
+
|
|
5
|
+
export { languagePackage }
|
|
6
|
+
|
|
7
|
+
export const carve = {
|
|
8
|
+
id: "carve",
|
|
9
|
+
aliases: [],
|
|
10
|
+
packageName: "@lumis-sh/wasm-carve",
|
|
11
|
+
wasm,
|
|
12
|
+
languagePackage,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default carve
|
package/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { languagePackage } from './language-package.js'
|
|
2
|
+
|
|
3
|
+
const wasm = new URL('./tree-sitter-carve.wasm', import.meta.url)
|
|
4
|
+
|
|
5
|
+
export { languagePackage }
|
|
6
|
+
|
|
7
|
+
export const carve = {
|
|
8
|
+
id: "carve",
|
|
9
|
+
aliases: [],
|
|
10
|
+
packageName: "@lumis-sh/wasm-carve",
|
|
11
|
+
wasm,
|
|
12
|
+
languagePackage,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default carve
|
package/index.workerd.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { languagePackage } from './language-package.js'
|
|
2
|
+
|
|
3
|
+
import wasm from './tree-sitter-carve.wasm'
|
|
4
|
+
|
|
5
|
+
export { languagePackage }
|
|
6
|
+
|
|
7
|
+
export const carve = {
|
|
8
|
+
id: "carve",
|
|
9
|
+
aliases: [],
|
|
10
|
+
packageName: "@lumis-sh/wasm-carve",
|
|
11
|
+
wasm,
|
|
12
|
+
languagePackage,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default carve
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const languagePackage = {
|
|
2
|
+
"packageName": "@lumis-sh/wasm-carve",
|
|
3
|
+
"version": "0.26.0",
|
|
4
|
+
"definitionHash": "3a66b1ba6fbfe0f021be95101b58a4ff1ad6446c4c9beac893f44803235755c7",
|
|
5
|
+
"parser": {
|
|
6
|
+
"name": "tree-sitter-carve",
|
|
7
|
+
"grammarName": "carve",
|
|
8
|
+
"upstreamVersion": "0.1.14",
|
|
9
|
+
"revision": "0f2eb839f7810151e2f1a6b1ed9400ef5c5c643d",
|
|
10
|
+
"sha256": "fcbc1c54a5f6f5df87f5dda5e8c3b4c5198326f5501de755bff037e2651dcd79",
|
|
11
|
+
"size": 5708888
|
|
12
|
+
},
|
|
13
|
+
"languages": {
|
|
14
|
+
"carve": {
|
|
15
|
+
"aliases": [],
|
|
16
|
+
"highlights": "; This file is auto-generated. Do not edit.\n(heading) @markup.heading\n\n((heading\n (marker) @_heading.marker) @markup.heading.1\n (#match? @_heading.marker \"^# +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.2\n (#match? @_heading.marker \"^## +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.3\n (#match? @_heading.marker \"^### +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.4\n (#match? @_heading.marker \"^#### +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.5\n (#match? @_heading.marker \"^##### +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.6\n (#match? @_heading.marker \"^###### +$\"))\n\n(thematic_break) @string.special\n\n[\n (div_marker_begin)\n (div_marker_end)\n] @punctuation.delimiter\n\n([\n (code_block)\n (raw_block)\n (frontmatter)\n] @markup.raw.block\n (#set! priority 90))\n\n; Remove @markup.raw for code with a language spec\n(code_block\n .\n (code_block_marker_begin)\n (language)\n (code) @none\n (#set! priority 90))\n\n[\n (code_block_marker_begin)\n (code_block_marker_end)\n (raw_block_marker_begin)\n (raw_block_marker_end)\n] @punctuation.delimiter\n\n(language) @attribute\n\n(inline_attribute\n _ @conceal\n (#set! conceal \"\"))\n\n((language_marker) @punctuation.delimiter\n (#set! conceal \"\"))\n\n(block_quote) @markup.quote\n\n(block_quote_marker) @punctuation.special\n\n; The colon fence's sigil family: `::: |`, `::: >` and `::: \\`. Each\n; opens a container whose body already carries its own color, so the sigil is\n; the only character saying which one opened - and none of the three was\n; painted, while every other marker node in this file is.\n(line_block_marker) @punctuation.special\n\n(block_quote_fence_marker) @punctuation.special\n\n(local_hard_break_marker) @punctuation.special\n\n(table_header) @markup.heading\n\n(table_header\n \"|\" @punctuation.special)\n\n(table_row\n \"|\" @punctuation.special)\n\n(table_separator) @punctuation.special\n\n(table_caption\n (marker) @punctuation.special)\n\n(table_caption) @markup.italic\n\n(caption\n (caption_marker) @punctuation.special)\n\n(caption\n (caption_content) @markup.italic)\n\n[\n (list_marker_dash)\n (list_marker_star)\n (list_marker_definition)\n (list_marker_description)\n (list_marker_decimal_period)\n (list_marker_decimal_paren)\n (list_marker_lower_alpha_period)\n (list_marker_lower_alpha_paren)\n (list_marker_upper_alpha_period)\n (list_marker_upper_alpha_paren)\n (list_marker_lower_roman_period)\n (list_marker_lower_roman_paren)\n (list_marker_upper_roman_period)\n (list_marker_upper_roman_paren)\n] @markup.list\n\n; The `+` continuation operator attaches the next block to its container.\n(list_continuation_marker) @operator\n\n(list_marker_task\n (unchecked)) @markup.list.unchecked\n\n(list_marker_task\n (checked)) @markup.list.checked\n\n; Colorize `x` in `[x]`\n((checked) @constant.builtin\n (#offset! @constant.builtin 0 1 0 -1))\n\n[\n (ellipsis)\n (en_dash)\n (em_dash)\n (quotation_marks)\n] @string.special\n\n(list_item\n (term) @type.definition)\n\n; Conceal the backslash of an escaped quote\n((quotation_marks) @string.special\n (#offset! @string.special 0 0 0 -1)\n (#set! conceal \"\"))\n\n[\n (hard_line_break)\n (backslash_escape)\n] @string.escape\n\n; Only conceal \\ but leave escaped character.\n((backslash_escape) @string.escape\n (#offset! @string.escape 0 0 0 -1)\n (#set! conceal \"\"))\n\n(frontmatter_marker) @punctuation.delimiter\n\n(emphasis) @markup.italic\n\n(strong) @markup.strong\n\n(bold_italic) @markup.strong\n(bold_italic) @markup.italic\n\n(underline) @markup.underline\n\n(strikethrough) @markup.strikethrough\n\n(symbol) @string.special.symbol\n\n(extension_inline) @function.macro\n\n; Reserved processor syntax (PART 9 section 19). The PARTS are captured, not the\n; whole run: the directive's own context already keeps `#section` away from the\n; tag rule and an option away from the mention rule, so there is nothing to gain\n; by painting it one colour - and a reader wants the path to look like a path.\n(include_open) @punctuation.special\n(include_close) @punctuation.special\n(include_path) @string.special.path\n(include_section) @label\n(include_option_name) @variable.parameter\n(include_option_separator) @punctuation.delimiter\n(include_option_value) @constant\n\n(mention) @constant\n\n(tag) @tag\n\n(insert) @markup.underline\n\n(delete) @markup.strikethrough\n\n(substitution) @markup.strikethrough\n(editorial_comment) @comment\n\n[\n (highlighted)\n (superscript)\n (subscript)\n] @string.special\n\n([\n (emphasis_begin)\n (emphasis_end)\n (bold_italic_begin)\n (bold_italic_end)\n (strong_begin)\n (strong_end)\n (underline_begin)\n (underline_end)\n (strikethrough_begin)\n (strikethrough_end)\n (superscript_begin)\n (superscript_end)\n (subscript_begin)\n (subscript_end)\n (highlighted_begin)\n (highlighted_end)\n (insert_begin)\n (insert_end)\n (delete_begin)\n (delete_end)\n (verbatim_marker_begin)\n (verbatim_marker_end)\n (math_marker)\n (math_marker_begin)\n (math_marker_end)\n (literal_marker)\n (literal_marker_begin)\n (literal_marker_end)\n (raw_inline_attribute)\n (raw_inline_marker_begin)\n (raw_inline_marker_end)\n] @punctuation.delimiter\n (#set! conceal \"\"))\n\n((math) @markup.math\n (#set! priority 90))\n\n(verbatim) @markup.raw\n\n((raw_inline) @markup.raw\n (#set! priority 90))\n\n; Inline literal renders as prose (no code/math face), so capture it plainly.\n(inline_literal) @none\n\n[\n (comment_line)\n (fenced_comment_block)\n (braced_comment)\n (trailing_comment)\n] @comment\n\n(span\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket)\n\n(inline_attribute\n [\n \"{\"\n \"}\"\n ] @punctuation.bracket)\n\n(block_attribute\n [\n \"{\"\n \"}\"\n ] @punctuation.bracket)\n\n; A `.foo` in an attribute block, and the colon fence's TYPE WORD. The second\n; used to be spelled `class_name` too, which is what the attribute's rule is\n; called - `admonition_type` is the construct the fence actually opens\n; (grammar.ebnf: any word after the separator is an admonition, and a generic\n; div is the opener with no word at all).\n[\n (class)\n (admonition_type)\n] @type\n\n; Composite figures (PART 9 4c, markup-carve/carve#1215). The kind word `figure`\n; is RESERVED among the `:::` types: a BARE opener - the fence, its separator,\n; the word, and nothing else - is ONE figure of ordered panels, not an\n; admonition. An opener carrying a quoted title or a `[label]` is not that\n; production and takes `@type` above, which is the generic Tier-2 container the\n; clause says it stays.\n;\n; THE PARSE TREE NOW SPELLS THE DISTINCTION, so this is one pattern over one\n; node. It used to be four: a pattern over the admonition's type word with\n; `!title !label` predicates, plus three wildcard chains restoring `@type` on a\n; bare opener nested inside a group, because a query has no transitive closure\n; and GROUPS DO NOT NEST at ANY depth. The chains reached three levels and the\n; residual was written down - a bare opener deeper than that kept the group\n; colour.\n;\n; Both go away because the demotion moved to where depth is free.\n; `src/scanner.c` reads its own open-block stack, so a bare opener inside an\n; open group is an `admonition_type` in the TREE - which is what the engine\n; builds for it too - and no query has to reconstruct the ancestry.\n;\n; The group caption needs no rule: it is an ordinary `^ ` line one line below\n; the closing fence, and the parser already places it as a sibling of the\n; container rather than inside it, where the existing `(caption)` patterns claim\n; it.\n(figure_group_marker) @type.builtin\n\n(identifier) @tag\n\n(key_value\n \"=\" @operator)\n\n(key_value\n (key) @property)\n\n(key_value\n (value) @string)\n\n(boolean_attribute) @property\n\n((span\n attribute: (inline_attribute\n (args\n (boolean_attribute) @attribute.builtin)))\n (#eq? @attribute.builtin \"kbd\"))\n\n((span\n attribute: (inline_attribute\n (args\n (key_value\n key: (key) @attribute.builtin))))\n (#any-of? @attribute.builtin \"abbr\" \"time\"))\n\n((_\n (block_attribute\n args: (args\n (boolean_attribute) @attribute.builtin))\n .\n [(block_attribute) (block_quote_marker)]*\n .\n (table\n language: (language) @_language))\n (#eq? @attribute.builtin \"table\")\n (#any-of? @_language \"csv\" \"tsv\"))\n\n; A CSV or TSV code include renders as a table under `{table}` too\n; (markup-carve/carve#3335); the include must be the paragraph's only content.\n((_\n (block_attribute\n args: (args\n (boolean_attribute) @attribute.builtin))\n .\n [(block_attribute) (block_quote_marker)]*\n .\n (paragraph\n .\n (include_directive\n option: (include_option\n name: (include_option_name) @_option\n value: (include_option_value) @_language))\n .))\n (#eq? @attribute.builtin \"table\")\n (#eq? @_option \"@code\")\n (#any-of? @_language \"csv\" \"tsv\"))\n\n((_\n (block_attribute\n args: (args\n (boolean_attribute) @attribute.builtin))\n .\n [(block_attribute) (block_quote_marker)]*\n .\n [\n (list)\n (definition_list)\n ])\n (#eq? @attribute.builtin \"loose\"))\n\n(language_attribute) @attribute\n\n(link_text\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket\n (#set! conceal \"\"))\n\n(autolink\n [\n \"<\"\n \">\"\n ] @punctuation.bracket\n (#set! conceal \"\"))\n\n(inline_link\n (inline_link_destination) @markup.link.url\n (#set! conceal \"\"))\n\n(link_reference_definition\n \":\" @punctuation.special)\n\n(full_reference_link\n (link_text) @markup.link)\n\n(full_reference_link\n (link_label) @markup.link.label\n (#set! conceal \"\"))\n\n(collapsed_reference_link\n \"[]\" @punctuation.bracket\n (#set! conceal \"\"))\n\n(full_reference_link\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket\n (#set! conceal \"\"))\n\n(collapsed_reference_link\n (link_text) @markup.link)\n\n(collapsed_reference_link\n (link_text) @markup.link.label)\n\n(inline_link\n (link_text) @markup.link)\n\n(full_reference_image\n (link_label) @markup.link.label)\n\n(full_reference_image\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket)\n\n(collapsed_reference_image\n \"[]\" @punctuation.bracket)\n\n(image_description\n [\n \"![\"\n \"]\"\n ] @punctuation.bracket)\n\n(image_description) @markup.italic\n\n(link_reference_definition\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket)\n\n(link_reference_definition\n (link_label) @markup.link.label)\n\n(inline_link_destination\n [\n \"(\"\n \")\"\n ] @punctuation.bracket)\n\n[\n (autolink)\n (inline_link_destination)\n (link_destination)\n (link_reference_definition)\n] @markup.link.url\n\n; A cross-reference with auto text is a LINK but not a URL: `</#Intro>` carries\n; a heading id the renderer resolves to the target's own text, so it takes\n; @markup.link rather than the @markup.link.url above. It used to parse as an\n; autolink and take that capture, which colored a crossref as a web address.\n(auto_text_link) @markup.link\n\n(abbreviation_definition\n (abbreviation_marker) @punctuation.special)\n\n(abbreviation_definition\n (abbreviation_expansion) @string)\n\n; Citations (§22 / Tier-2 extension)\n(citation_group) @string.special\n\n(citation_definition\n (citation_label) @markup.link.label)\n\n(citation_definition\n (citation_entry) @string)\n\n; Callout list (§10 / Tier-2 extension)\n(callout_list) @markup.list\n\n(callout_list_item) @markup.list\n\n(footnote\n (reference_label) @markup.link.label)\n\n(footnote_reference\n (reference_label) @markup.link.label)\n\n; An inline note, `^[content]`. Its content is ordinary inline and highlights\n; itself; this marks the note as a whole so a reader can see where it ends -\n; which is the thing the construct is easy to get wrong about, and which this\n; grammar does get wrong for a note holding a bracket run that forms no span\n; (see the RECORDED GAP fixture). Painting the whole node is what makes that\n; visible in an editor rather than only in a tree dump.\n(inline_note) @markup.link.label\n\n[\n (footnote_marker_begin)\n (footnote_marker_end)\n] @punctuation.bracket\n\n; TODO / NOTE / FIXME inside comments come from the comment injection; in\n; prose they are ordinary words.\n[\n (paragraph)\n (table_cell)\n (comment_line)\n (trailing_comment)\n (fenced_comment_block)\n (braced_comment)\n] \n\n[\n (autolink)\n (auto_text_link)\n (inline_link_destination)\n (link_destination)\n (code_block)\n (raw_block)\n (math)\n (raw_inline)\n (verbatim)\n (inline_literal)\n (reference_label)\n (class)\n (admonition_type)\n (identifier)\n (key_value)\n (frontmatter)\n] \n\n(table\n (code) )\n\n(full_reference_link\n (link_label) )\n\n(full_reference_image\n (link_label) )\n\n(invalid_metadata) @error",
|
|
17
|
+
"injections": "; This file is auto-generated. Do not edit.\n([\n (comment_line)\n (trailing_comment)\n] @injection.content\n (#set! injection.language \"comment\")\n (#match? @injection.content \"TODO|WIP|NOTE|XXX|INFO|DOCS|PERF|TEST|HACK|WARN|FIX|BUG|ERROR|#[0-9]+|https?://\"))\n\n; Upstream captures `(content)` inside a `[...]` alternation of\n; `fenced_comment_block` and `braced_comment`. The comment injection filter\n; cannot attach `#match?` to a capture inside an alternation, so preprocessing\n; fails. Each alternative gets its own pattern; the matches are unchanged.\n(fenced_comment_block\n (content) @injection.content\n (#set! injection.language \"comment\")\n (#match? @injection.content \"TODO|WIP|NOTE|XXX|INFO|DOCS|PERF|TEST|HACK|WARN|FIX|BUG|ERROR|#[0-9]+|https?://\"))\n\n(braced_comment\n (content) @injection.content\n (#set! injection.language \"comment\")\n (#match? @injection.content \"TODO|WIP|NOTE|XXX|INFO|DOCS|PERF|TEST|HACK|WARN|FIX|BUG|ERROR|#[0-9]+|https?://\"))\n\n(math\n (content) @injection.content\n (#set! injection.language \"latex\"))\n\n(code_block\n (language) @injection.language\n (code) @injection.content)\n\n(table\n (language) @injection.language\n (code) @injection.content)\n\n(raw_block\n (raw_block_info\n (language) @injection.language)\n (content) @injection.content)\n\n(raw_inline\n (content) @injection.content\n (raw_inline_attribute\n (language) @injection.language))\n\n(frontmatter\n (language) @injection.language\n (frontmatter_content) @injection.content)\n\n; Plain `---` frontmatter is YAML.\n(frontmatter\n !language\n (frontmatter_content) @injection.content\n (#set! injection.language \"yaml\"))\n",
|
|
18
|
+
"locals": "; This file is auto-generated. Do not edit.\n(link_reference_definition\n (link_label) @local.definition)\n\n(footnote\n (reference_label) @local.definition)\n\n(collapsed_reference_link\n (link_text) @local.reference)\n\n(full_reference_link\n (link_label) @local.reference)\n\n(full_reference_image\n (link_label) @local.reference)\n\n(footnote_reference\n (reference_label) @local.reference)",
|
|
19
|
+
"brackets": "; This file is auto-generated. Do not edit.\n(\"(\" @open\n \")\" @close)\n\n(\"[\" @open\n \"]\" @close)\n\n(\"{\" @open\n \"}\" @close)\n"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/lumis.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packageName": "@lumis-sh/wasm-carve",
|
|
3
|
+
"version": "0.26.0",
|
|
4
|
+
"definitionHash": "3a66b1ba6fbfe0f021be95101b58a4ff1ad6446c4c9beac893f44803235755c7",
|
|
5
|
+
"parser": {
|
|
6
|
+
"name": "tree-sitter-carve",
|
|
7
|
+
"grammarName": "carve",
|
|
8
|
+
"upstreamVersion": "0.1.14",
|
|
9
|
+
"revision": "0f2eb839f7810151e2f1a6b1ed9400ef5c5c643d",
|
|
10
|
+
"sha256": "fcbc1c54a5f6f5df87f5dda5e8c3b4c5198326f5501de755bff037e2651dcd79",
|
|
11
|
+
"size": 5708888
|
|
12
|
+
},
|
|
13
|
+
"languages": {
|
|
14
|
+
"carve": {
|
|
15
|
+
"aliases": [],
|
|
16
|
+
"highlights": "; This file is auto-generated. Do not edit.\n(heading) @markup.heading\n\n((heading\n (marker) @_heading.marker) @markup.heading.1\n (#match? @_heading.marker \"^# +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.2\n (#match? @_heading.marker \"^## +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.3\n (#match? @_heading.marker \"^### +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.4\n (#match? @_heading.marker \"^#### +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.5\n (#match? @_heading.marker \"^##### +$\"))\n\n((heading\n (marker) @_heading.marker) @markup.heading.6\n (#match? @_heading.marker \"^###### +$\"))\n\n(thematic_break) @string.special\n\n[\n (div_marker_begin)\n (div_marker_end)\n] @punctuation.delimiter\n\n([\n (code_block)\n (raw_block)\n (frontmatter)\n] @markup.raw.block\n (#set! priority 90))\n\n; Remove @markup.raw for code with a language spec\n(code_block\n .\n (code_block_marker_begin)\n (language)\n (code) @none\n (#set! priority 90))\n\n[\n (code_block_marker_begin)\n (code_block_marker_end)\n (raw_block_marker_begin)\n (raw_block_marker_end)\n] @punctuation.delimiter\n\n(language) @attribute\n\n(inline_attribute\n _ @conceal\n (#set! conceal \"\"))\n\n((language_marker) @punctuation.delimiter\n (#set! conceal \"\"))\n\n(block_quote) @markup.quote\n\n(block_quote_marker) @punctuation.special\n\n; The colon fence's sigil family: `::: |`, `::: >` and `::: \\`. Each\n; opens a container whose body already carries its own color, so the sigil is\n; the only character saying which one opened - and none of the three was\n; painted, while every other marker node in this file is.\n(line_block_marker) @punctuation.special\n\n(block_quote_fence_marker) @punctuation.special\n\n(local_hard_break_marker) @punctuation.special\n\n(table_header) @markup.heading\n\n(table_header\n \"|\" @punctuation.special)\n\n(table_row\n \"|\" @punctuation.special)\n\n(table_separator) @punctuation.special\n\n(table_caption\n (marker) @punctuation.special)\n\n(table_caption) @markup.italic\n\n(caption\n (caption_marker) @punctuation.special)\n\n(caption\n (caption_content) @markup.italic)\n\n[\n (list_marker_dash)\n (list_marker_star)\n (list_marker_definition)\n (list_marker_description)\n (list_marker_decimal_period)\n (list_marker_decimal_paren)\n (list_marker_lower_alpha_period)\n (list_marker_lower_alpha_paren)\n (list_marker_upper_alpha_period)\n (list_marker_upper_alpha_paren)\n (list_marker_lower_roman_period)\n (list_marker_lower_roman_paren)\n (list_marker_upper_roman_period)\n (list_marker_upper_roman_paren)\n] @markup.list\n\n; The `+` continuation operator attaches the next block to its container.\n(list_continuation_marker) @operator\n\n(list_marker_task\n (unchecked)) @markup.list.unchecked\n\n(list_marker_task\n (checked)) @markup.list.checked\n\n; Colorize `x` in `[x]`\n((checked) @constant.builtin\n (#offset! @constant.builtin 0 1 0 -1))\n\n[\n (ellipsis)\n (en_dash)\n (em_dash)\n (quotation_marks)\n] @string.special\n\n(list_item\n (term) @type.definition)\n\n; Conceal the backslash of an escaped quote\n((quotation_marks) @string.special\n (#offset! @string.special 0 0 0 -1)\n (#set! conceal \"\"))\n\n[\n (hard_line_break)\n (backslash_escape)\n] @string.escape\n\n; Only conceal \\ but leave escaped character.\n((backslash_escape) @string.escape\n (#offset! @string.escape 0 0 0 -1)\n (#set! conceal \"\"))\n\n(frontmatter_marker) @punctuation.delimiter\n\n(emphasis) @markup.italic\n\n(strong) @markup.strong\n\n(bold_italic) @markup.strong\n(bold_italic) @markup.italic\n\n(underline) @markup.underline\n\n(strikethrough) @markup.strikethrough\n\n(symbol) @string.special.symbol\n\n(extension_inline) @function.macro\n\n; Reserved processor syntax (PART 9 section 19). The PARTS are captured, not the\n; whole run: the directive's own context already keeps `#section` away from the\n; tag rule and an option away from the mention rule, so there is nothing to gain\n; by painting it one colour - and a reader wants the path to look like a path.\n(include_open) @punctuation.special\n(include_close) @punctuation.special\n(include_path) @string.special.path\n(include_section) @label\n(include_option_name) @variable.parameter\n(include_option_separator) @punctuation.delimiter\n(include_option_value) @constant\n\n(mention) @constant\n\n(tag) @tag\n\n(insert) @markup.underline\n\n(delete) @markup.strikethrough\n\n(substitution) @markup.strikethrough\n(editorial_comment) @comment\n\n[\n (highlighted)\n (superscript)\n (subscript)\n] @string.special\n\n([\n (emphasis_begin)\n (emphasis_end)\n (bold_italic_begin)\n (bold_italic_end)\n (strong_begin)\n (strong_end)\n (underline_begin)\n (underline_end)\n (strikethrough_begin)\n (strikethrough_end)\n (superscript_begin)\n (superscript_end)\n (subscript_begin)\n (subscript_end)\n (highlighted_begin)\n (highlighted_end)\n (insert_begin)\n (insert_end)\n (delete_begin)\n (delete_end)\n (verbatim_marker_begin)\n (verbatim_marker_end)\n (math_marker)\n (math_marker_begin)\n (math_marker_end)\n (literal_marker)\n (literal_marker_begin)\n (literal_marker_end)\n (raw_inline_attribute)\n (raw_inline_marker_begin)\n (raw_inline_marker_end)\n] @punctuation.delimiter\n (#set! conceal \"\"))\n\n((math) @markup.math\n (#set! priority 90))\n\n(verbatim) @markup.raw\n\n((raw_inline) @markup.raw\n (#set! priority 90))\n\n; Inline literal renders as prose (no code/math face), so capture it plainly.\n(inline_literal) @none\n\n[\n (comment_line)\n (fenced_comment_block)\n (braced_comment)\n (trailing_comment)\n] @comment\n\n(span\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket)\n\n(inline_attribute\n [\n \"{\"\n \"}\"\n ] @punctuation.bracket)\n\n(block_attribute\n [\n \"{\"\n \"}\"\n ] @punctuation.bracket)\n\n; A `.foo` in an attribute block, and the colon fence's TYPE WORD. The second\n; used to be spelled `class_name` too, which is what the attribute's rule is\n; called - `admonition_type` is the construct the fence actually opens\n; (grammar.ebnf: any word after the separator is an admonition, and a generic\n; div is the opener with no word at all).\n[\n (class)\n (admonition_type)\n] @type\n\n; Composite figures (PART 9 4c, markup-carve/carve#1215). The kind word `figure`\n; is RESERVED among the `:::` types: a BARE opener - the fence, its separator,\n; the word, and nothing else - is ONE figure of ordered panels, not an\n; admonition. An opener carrying a quoted title or a `[label]` is not that\n; production and takes `@type` above, which is the generic Tier-2 container the\n; clause says it stays.\n;\n; THE PARSE TREE NOW SPELLS THE DISTINCTION, so this is one pattern over one\n; node. It used to be four: a pattern over the admonition's type word with\n; `!title !label` predicates, plus three wildcard chains restoring `@type` on a\n; bare opener nested inside a group, because a query has no transitive closure\n; and GROUPS DO NOT NEST at ANY depth. The chains reached three levels and the\n; residual was written down - a bare opener deeper than that kept the group\n; colour.\n;\n; Both go away because the demotion moved to where depth is free.\n; `src/scanner.c` reads its own open-block stack, so a bare opener inside an\n; open group is an `admonition_type` in the TREE - which is what the engine\n; builds for it too - and no query has to reconstruct the ancestry.\n;\n; The group caption needs no rule: it is an ordinary `^ ` line one line below\n; the closing fence, and the parser already places it as a sibling of the\n; container rather than inside it, where the existing `(caption)` patterns claim\n; it.\n(figure_group_marker) @type.builtin\n\n(identifier) @tag\n\n(key_value\n \"=\" @operator)\n\n(key_value\n (key) @property)\n\n(key_value\n (value) @string)\n\n(boolean_attribute) @property\n\n((span\n attribute: (inline_attribute\n (args\n (boolean_attribute) @attribute.builtin)))\n (#eq? @attribute.builtin \"kbd\"))\n\n((span\n attribute: (inline_attribute\n (args\n (key_value\n key: (key) @attribute.builtin))))\n (#any-of? @attribute.builtin \"abbr\" \"time\"))\n\n((_\n (block_attribute\n args: (args\n (boolean_attribute) @attribute.builtin))\n .\n [(block_attribute) (block_quote_marker)]*\n .\n (table\n language: (language) @_language))\n (#eq? @attribute.builtin \"table\")\n (#any-of? @_language \"csv\" \"tsv\"))\n\n; A CSV or TSV code include renders as a table under `{table}` too\n; (markup-carve/carve#3335); the include must be the paragraph's only content.\n((_\n (block_attribute\n args: (args\n (boolean_attribute) @attribute.builtin))\n .\n [(block_attribute) (block_quote_marker)]*\n .\n (paragraph\n .\n (include_directive\n option: (include_option\n name: (include_option_name) @_option\n value: (include_option_value) @_language))\n .))\n (#eq? @attribute.builtin \"table\")\n (#eq? @_option \"@code\")\n (#any-of? @_language \"csv\" \"tsv\"))\n\n((_\n (block_attribute\n args: (args\n (boolean_attribute) @attribute.builtin))\n .\n [(block_attribute) (block_quote_marker)]*\n .\n [\n (list)\n (definition_list)\n ])\n (#eq? @attribute.builtin \"loose\"))\n\n(language_attribute) @attribute\n\n(link_text\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket\n (#set! conceal \"\"))\n\n(autolink\n [\n \"<\"\n \">\"\n ] @punctuation.bracket\n (#set! conceal \"\"))\n\n(inline_link\n (inline_link_destination) @markup.link.url\n (#set! conceal \"\"))\n\n(link_reference_definition\n \":\" @punctuation.special)\n\n(full_reference_link\n (link_text) @markup.link)\n\n(full_reference_link\n (link_label) @markup.link.label\n (#set! conceal \"\"))\n\n(collapsed_reference_link\n \"[]\" @punctuation.bracket\n (#set! conceal \"\"))\n\n(full_reference_link\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket\n (#set! conceal \"\"))\n\n(collapsed_reference_link\n (link_text) @markup.link)\n\n(collapsed_reference_link\n (link_text) @markup.link.label)\n\n(inline_link\n (link_text) @markup.link)\n\n(full_reference_image\n (link_label) @markup.link.label)\n\n(full_reference_image\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket)\n\n(collapsed_reference_image\n \"[]\" @punctuation.bracket)\n\n(image_description\n [\n \"![\"\n \"]\"\n ] @punctuation.bracket)\n\n(image_description) @markup.italic\n\n(link_reference_definition\n [\n \"[\"\n \"]\"\n ] @punctuation.bracket)\n\n(link_reference_definition\n (link_label) @markup.link.label)\n\n(inline_link_destination\n [\n \"(\"\n \")\"\n ] @punctuation.bracket)\n\n[\n (autolink)\n (inline_link_destination)\n (link_destination)\n (link_reference_definition)\n] @markup.link.url\n\n; A cross-reference with auto text is a LINK but not a URL: `</#Intro>` carries\n; a heading id the renderer resolves to the target's own text, so it takes\n; @markup.link rather than the @markup.link.url above. It used to parse as an\n; autolink and take that capture, which colored a crossref as a web address.\n(auto_text_link) @markup.link\n\n(abbreviation_definition\n (abbreviation_marker) @punctuation.special)\n\n(abbreviation_definition\n (abbreviation_expansion) @string)\n\n; Citations (§22 / Tier-2 extension)\n(citation_group) @string.special\n\n(citation_definition\n (citation_label) @markup.link.label)\n\n(citation_definition\n (citation_entry) @string)\n\n; Callout list (§10 / Tier-2 extension)\n(callout_list) @markup.list\n\n(callout_list_item) @markup.list\n\n(footnote\n (reference_label) @markup.link.label)\n\n(footnote_reference\n (reference_label) @markup.link.label)\n\n; An inline note, `^[content]`. Its content is ordinary inline and highlights\n; itself; this marks the note as a whole so a reader can see where it ends -\n; which is the thing the construct is easy to get wrong about, and which this\n; grammar does get wrong for a note holding a bracket run that forms no span\n; (see the RECORDED GAP fixture). Painting the whole node is what makes that\n; visible in an editor rather than only in a tree dump.\n(inline_note) @markup.link.label\n\n[\n (footnote_marker_begin)\n (footnote_marker_end)\n] @punctuation.bracket\n\n; TODO / NOTE / FIXME inside comments come from the comment injection; in\n; prose they are ordinary words.\n[\n (paragraph)\n (table_cell)\n (comment_line)\n (trailing_comment)\n (fenced_comment_block)\n (braced_comment)\n] \n\n[\n (autolink)\n (auto_text_link)\n (inline_link_destination)\n (link_destination)\n (code_block)\n (raw_block)\n (math)\n (raw_inline)\n (verbatim)\n (inline_literal)\n (reference_label)\n (class)\n (admonition_type)\n (identifier)\n (key_value)\n (frontmatter)\n] \n\n(table\n (code) )\n\n(full_reference_link\n (link_label) )\n\n(full_reference_image\n (link_label) )\n\n(invalid_metadata) @error",
|
|
17
|
+
"injections": "; This file is auto-generated. Do not edit.\n([\n (comment_line)\n (trailing_comment)\n] @injection.content\n (#set! injection.language \"comment\")\n (#match? @injection.content \"TODO|WIP|NOTE|XXX|INFO|DOCS|PERF|TEST|HACK|WARN|FIX|BUG|ERROR|#[0-9]+|https?://\"))\n\n; Upstream captures `(content)` inside a `[...]` alternation of\n; `fenced_comment_block` and `braced_comment`. The comment injection filter\n; cannot attach `#match?` to a capture inside an alternation, so preprocessing\n; fails. Each alternative gets its own pattern; the matches are unchanged.\n(fenced_comment_block\n (content) @injection.content\n (#set! injection.language \"comment\")\n (#match? @injection.content \"TODO|WIP|NOTE|XXX|INFO|DOCS|PERF|TEST|HACK|WARN|FIX|BUG|ERROR|#[0-9]+|https?://\"))\n\n(braced_comment\n (content) @injection.content\n (#set! injection.language \"comment\")\n (#match? @injection.content \"TODO|WIP|NOTE|XXX|INFO|DOCS|PERF|TEST|HACK|WARN|FIX|BUG|ERROR|#[0-9]+|https?://\"))\n\n(math\n (content) @injection.content\n (#set! injection.language \"latex\"))\n\n(code_block\n (language) @injection.language\n (code) @injection.content)\n\n(table\n (language) @injection.language\n (code) @injection.content)\n\n(raw_block\n (raw_block_info\n (language) @injection.language)\n (content) @injection.content)\n\n(raw_inline\n (content) @injection.content\n (raw_inline_attribute\n (language) @injection.language))\n\n(frontmatter\n (language) @injection.language\n (frontmatter_content) @injection.content)\n\n; Plain `---` frontmatter is YAML.\n(frontmatter\n !language\n (frontmatter_content) @injection.content\n (#set! injection.language \"yaml\"))\n",
|
|
18
|
+
"locals": "; This file is auto-generated. Do not edit.\n(link_reference_definition\n (link_label) @local.definition)\n\n(footnote\n (reference_label) @local.definition)\n\n(collapsed_reference_link\n (link_text) @local.reference)\n\n(full_reference_link\n (link_label) @local.reference)\n\n(full_reference_image\n (link_label) @local.reference)\n\n(footnote_reference\n (reference_label) @local.reference)",
|
|
19
|
+
"brackets": "; This file is auto-generated. Do not edit.\n(\"(\" @open\n \")\" @close)\n\n(\"[\" @open\n \"]\" @close)\n\n(\"{\" @open\n \"}\" @close)\n"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumis-sh/wasm-carve",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.26.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"types": "./index.d.ts",
|
|
6
|
+
"description": "Tree-sitter parser and queries for carve, compiled to WASM for Lumis",
|
|
7
|
+
"author": "Leandro Pereira",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"homepage": "https://lumis.sh",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/leandrocp/lumis.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"workerd": "./index.workerd.js",
|
|
18
|
+
"edge-light": "./index.edge.js",
|
|
19
|
+
"default": "./index.js"
|
|
20
|
+
},
|
|
21
|
+
"./tree-sitter-carve.wasm": "./tree-sitter-carve.wasm",
|
|
22
|
+
"./lumis.json": "./lumis.json"
|
|
23
|
+
},
|
|
24
|
+
"lumis": {
|
|
25
|
+
"treeSitter": "0.26",
|
|
26
|
+
"formatVersion": 5,
|
|
27
|
+
"definitionHash": "3a66b1ba6fbfe0f021be95101b58a4ff1ad6446c4c9beac893f44803235755c7"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@lumis-sh/lumis": ">=0.9.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependenciesMeta": {
|
|
33
|
+
"@lumis-sh/lumis": { "optional": true }
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {},
|
|
36
|
+
"keywords": ["lumis-sh", "wasm", "tree-sitter"],
|
|
37
|
+
"files": ["*.wasm", "*.json", "*.js", "*.d.ts", "README.md", "LICENSE"]
|
|
38
|
+
}
|
|
Binary file
|