Compare commits
No commits in common. "e4b9247c45220f12e707905dc226fa726407ea01" and "6d80c661442072dc84de6647754521cc1477e5d3" have entirely different histories.
e4b9247c45
...
6d80c66144
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -25,7 +25,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|||
|
||||
[[package]]
|
||||
name = "decodal"
|
||||
version = "0.1.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"decodal-derive",
|
||||
"regex",
|
||||
|
|
@ -33,14 +33,14 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "decodal-cli"
|
||||
version = "0.1.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"decodal",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "decodal-derive"
|
||||
version = "0.1.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"decodal",
|
||||
"proc-macro2",
|
||||
|
|
@ -50,7 +50,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "decodal-wasm"
|
||||
version = "0.1.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"decodal",
|
||||
"serde_json",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ members = [
|
|||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.2"
|
||||
version = "0.1.1"
|
||||
edition = "2024"
|
||||
rust-version = "1.85"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@ default = []
|
|||
regex = ["decodal/regex"]
|
||||
|
||||
[dependencies]
|
||||
decodal = { version = "0.1.2", path = "../decodal-core" }
|
||||
decodal = { version = "0.1.1", path = "../decodal-core" }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ publish = false
|
|||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
decodal = { version = "0.1.2", path = "../decodal-core" }
|
||||
decodal = { version = "0.1.1", path = "../decodal-core" }
|
||||
serde_json.workspace = true
|
||||
wasm-bindgen.workspace = true
|
||||
|
||||
|
|
|
|||
|
|
@ -45,14 +45,11 @@ Important paths:
|
|||
|
||||
```text
|
||||
editors/lezer-decodal/decodal.grammar
|
||||
packages/decodal-codemirror/src/decodal.js
|
||||
packages/decodal-codemirror/src/decodal-parser.js
|
||||
packages/decodal-codemirror/src/decodal-parser.terms.js
|
||||
site/decodal-site/src/lib/codemirror/decodal-parser.js
|
||||
site/decodal-site/src/lib/codemirror/decodal-parser.terms.js
|
||||
site/decodal-site/src/lib/codemirror/decodal.js
|
||||
```
|
||||
|
||||
The npm package is `decodal-codemirror`.
|
||||
The JSR package is `@hare/decodal-codemirror`.
|
||||
|
||||
The Lezer grammar is derived from the canonical grammar documentation, but it is not a literal copy of the EBNF.
|
||||
Precedence and token conflict handling are represented in the Lezer grammar in the form CodeMirror needs.
|
||||
|
||||
|
|
|
|||
|
|
@ -23,19 +23,13 @@ cargo run -q -p decodal-cli --features regex -- examples/regex/main.dcdl
|
|||
## crates.io release
|
||||
|
||||
The primary crates.io package is `decodal`, which contains the embeddable library.
|
||||
`decodal-derive` provides optional derive macros for Rust struct integration and is published only when the derive crate changes.
|
||||
Workspace support crates such as `decodal-cli` and the Rust source crate `decodal-wasm` are not published to crates.io.
|
||||
The generated WebAssembly package under `site/decodal-site/src/wasm/` is published to npm and JSR.
|
||||
`decodal-derive` provides optional derive macros for Rust struct integration.
|
||||
Workspace support crates such as `decodal-cli` and `decodal-wasm` are not published for 0.1.0.
|
||||
The project is dual licensed as `MIT OR Apache-2.0`.
|
||||
|
||||
```sh
|
||||
cargo publish -p decodal
|
||||
```
|
||||
|
||||
Publish `decodal-derive` first only when that crate has a new version:
|
||||
|
||||
```sh
|
||||
cargo publish -p decodal-derive
|
||||
cargo publish -p decodal
|
||||
```
|
||||
|
||||
Before publishing, run:
|
||||
|
|
@ -44,11 +38,10 @@ Before publishing, run:
|
|||
cargo fmt --check
|
||||
cargo test
|
||||
cargo check -p decodal --no-default-features
|
||||
cargo publish -p decodal-derive --dry-run
|
||||
cargo publish -p decodal --dry-run
|
||||
```
|
||||
|
||||
If `decodal-derive` changed, also run `cargo publish -p decodal-derive --dry-run`.
|
||||
|
||||
## Web site and playground
|
||||
|
||||
The Astro documentation site and browser playground are kept in:
|
||||
|
|
@ -68,10 +61,10 @@ site/decodal-site/src/pages/playground.astro
|
|||
site/decodal-site/src/scripts/playground.js
|
||||
site/decodal-site/src/scripts/playground-examples.js
|
||||
site/decodal-site/src/layouts/ManualLayout.astro
|
||||
site/decodal-site/src/lib/codemirror/decodal.js
|
||||
site/decodal-site/src/lib/codemirror/decodal-parser.js
|
||||
site/decodal-site/src/lib/docs.js
|
||||
site/decodal-site/src/lib/highlight.js
|
||||
packages/decodal-codemirror/src/decodal.js
|
||||
packages/decodal-codemirror/src/decodal-parser.js
|
||||
crates/decodal-wasm/src/lib.rs
|
||||
```
|
||||
|
||||
|
|
@ -92,49 +85,8 @@ site/decodal-site/src/wasm/
|
|||
|
||||
These generated files are committed so the site can be built without requiring every consumer to regenerate the wasm package first.
|
||||
|
||||
Publish the generated WebAssembly package from its package directory:
|
||||
|
||||
```sh
|
||||
cd site/decodal-site/src/wasm
|
||||
npm publish
|
||||
npx jsr publish
|
||||
```
|
||||
|
||||
Run dry-runs first when preparing a release:
|
||||
|
||||
```sh
|
||||
npm pack --dry-run
|
||||
npx jsr publish --dry-run
|
||||
```
|
||||
|
||||
The npm package name is `decodal-wasm`.
|
||||
The JSR package name is `@hare/decodal-wasm`.
|
||||
JSR currently expects a single SPDX license identifier in `jsr.json`; the WebAssembly package metadata uses `MIT` while the Rust workspace remains dual licensed as `MIT OR Apache-2.0`.
|
||||
|
||||
The playground editor uses the `decodal-codemirror` package with the generated Lezer parser in `packages/decodal-codemirror/src/decodal-parser.js`.
|
||||
The playground editor uses CodeMirror 6 with the generated Lezer parser in `src/lib/codemirror/decodal-parser.js`.
|
||||
The canonical grammar is documented in `doc/manual/souce/language/grammar.md`; regenerate the Lezer parser when that grammar or `editors/lezer-decodal/decodal.grammar` changes.
|
||||
|
||||
Publish the CodeMirror package from its package directory:
|
||||
|
||||
```sh
|
||||
cd packages/decodal-codemirror
|
||||
npm install
|
||||
npm publish
|
||||
npx jsr publish
|
||||
```
|
||||
|
||||
Run dry-runs first when preparing a release:
|
||||
|
||||
```sh
|
||||
npm install
|
||||
npm pack --dry-run
|
||||
npx jsr publish --dry-run
|
||||
```
|
||||
|
||||
The npm package name is `decodal-codemirror`.
|
||||
The JSR package name is `@hare/decodal-codemirror`.
|
||||
JSR currently expects a single SPDX license identifier in `jsr.json`; the CodeMirror package metadata uses `MIT` while the Rust workspace remains dual licensed as `MIT OR Apache-2.0`.
|
||||
|
||||
The documentation build still uses the lightweight JavaScript fallback highlighter so Astro can render Markdown without initializing WASM at build time.
|
||||
|
||||
To run the site locally:
|
||||
|
|
@ -216,7 +168,7 @@ When the Decodal syntax changes:
|
|||
|
||||
```sh
|
||||
cd site/decodal-site
|
||||
npx lezer-generator ../../editors/lezer-decodal/decodal.grammar -o ../../packages/decodal-codemirror/src/decodal-parser.js
|
||||
npx lezer-generator ../../editors/lezer-decodal/decodal.grammar -o src/lib/codemirror/decodal-parser.js
|
||||
```
|
||||
|
||||
5. Add or update corpus/tests/examples.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Regenerate the CodeMirror parser from the site directory:
|
|||
|
||||
```sh
|
||||
cd ../../site/decodal-site
|
||||
npx lezer-generator ../../editors/lezer-decodal/decodal.grammar -o ../../packages/decodal-codemirror/src/decodal-parser.js
|
||||
npx lezer-generator ../../editors/lezer-decodal/decodal.grammar -o src/lib/codemirror/decodal-parser.js
|
||||
```
|
||||
|
||||
The generated parser is committed with the `decodal-codemirror` package because both the playground and external Web editors consume it.
|
||||
The generated parser is committed with the site because the playground imports it directly.
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
# decodal-codemirror
|
||||
|
||||
CodeMirror 6 language support for Decodal.
|
||||
|
||||
This package provides the Lezer parser metadata, highlighting tags, indentation rules, and block folding used by the Decodal Web playground.
|
||||
It does not include the Decodal runtime or WebAssembly evaluator.
|
||||
Use `decodal-wasm` when you want to evaluate Decodal in a browser.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install decodal-codemirror
|
||||
```
|
||||
|
||||
JSR:
|
||||
|
||||
```sh
|
||||
deno add jsr:@hare/decodal-codemirror
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { basicSetup } from 'codemirror';
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { decodal } from 'decodal-codemirror';
|
||||
|
||||
new EditorView({
|
||||
doc: 'Server = { port = Int default 8080; };',
|
||||
extensions: [
|
||||
basicSetup,
|
||||
decodal(),
|
||||
],
|
||||
parent: document.querySelector('#editor'),
|
||||
});
|
||||
```
|
||||
|
||||
## Exports
|
||||
|
||||
```js
|
||||
import {
|
||||
decodal,
|
||||
decodalLanguage,
|
||||
decodalHighlightStyle,
|
||||
} from 'decodal-codemirror';
|
||||
```
|
||||
|
||||
`decodal()` accepts a small options object:
|
||||
|
||||
```js
|
||||
decodal({ highlight: false })
|
||||
```
|
||||
|
||||
Use this when you want the language support without the bundled highlight style.
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"name": "@hare/decodal-codemirror",
|
||||
"version": "0.1.2",
|
||||
"license": "MIT",
|
||||
"exports": "./src/mod.ts",
|
||||
"imports": {
|
||||
"@codemirror/language": "npm:@codemirror/language@^6.12.4",
|
||||
"@lezer/highlight": "npm:@lezer/highlight@^1.2.3",
|
||||
"@lezer/lr": "npm:@lezer/lr@^1.4.10"
|
||||
},
|
||||
"publish": {
|
||||
"include": [
|
||||
"README.md",
|
||||
"src/mod.ts",
|
||||
"src/decodal.js",
|
||||
"src/decodal.d.ts",
|
||||
"src/decodal.js.d.ts",
|
||||
"src/decodal-parser-jsr.js",
|
||||
"src/decodal-parser.js",
|
||||
"src/decodal-parser.terms.js",
|
||||
"package.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
101
packages/decodal-codemirror/package-lock.json
generated
101
packages/decodal-codemirror/package-lock.json
generated
|
|
@ -1,101 +0,0 @@
|
|||
{
|
||||
"name": "decodal-codemirror",
|
||||
"version": "0.1.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "decodal-codemirror",
|
||||
"version": "0.1.2",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.12.4",
|
||||
"@lezer/highlight": "^1.2.3",
|
||||
"@lezer/lr": "^1.4.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/language": {
|
||||
"version": "6.12.4",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.12.4.tgz",
|
||||
"integrity": "sha512-1q4PaT+o6PbgpkJt4Q8Fv5XJxTy4FUZ4MWETtyiDw3J0Pyr9E2vqcKL+k9wcvjNTIsauxvE7OfmWj3FRPHQ76A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.23.0",
|
||||
"@lezer/common": "^1.5.0",
|
||||
"@lezer/highlight": "^1.0.0",
|
||||
"@lezer/lr": "^1.0.0",
|
||||
"style-mod": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/state": {
|
||||
"version": "6.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.1.tgz",
|
||||
"integrity": "sha512-9QzNDgE4EYDnAHfrTlR2lwiPciiOymLtwKK+8yHQzCc7GXhAP9xdEbEJFy2IWB1j9UGUl9BsgMmTo/ImA02T7A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@marijn/find-cluster-break": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/view": {
|
||||
"version": "6.43.6",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.6.tgz",
|
||||
"integrity": "sha512-EVunGSYN1wz1p75WY1s3Xg7t3i8Yol0kGZGizNdX9BUFgMFILYVe8/u6EVpo7Ff5PwbZuILb4QAq7IZoKzIEQA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.7.0",
|
||||
"crelt": "^1.0.6",
|
||||
"style-mod": "^4.1.0",
|
||||
"w3c-keyname": "^2.2.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@lezer/common": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.2.tgz",
|
||||
"integrity": "sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@lezer/highlight": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.3.tgz",
|
||||
"integrity": "sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@lezer/lr": {
|
||||
"version": "1.4.10",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.10.tgz",
|
||||
"integrity": "sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@marijn/find-cluster-break": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.3.tgz",
|
||||
"integrity": "sha512-FY+MKLBoTsLNJF/eLWaOsXGdz6uh3Iu1axjPf6TUq92IYumcTcXWHoS747JARLkcdlJ/Waiaxc5wQfFO8jC6NA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/crelt": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.7.tgz",
|
||||
"integrity": "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/style-mod": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.3.tgz",
|
||||
"integrity": "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/w3c-keyname": {
|
||||
"version": "2.2.8",
|
||||
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
|
||||
"integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"name": "decodal-codemirror",
|
||||
"version": "0.1.2",
|
||||
"description": "CodeMirror 6 language support for Decodal.",
|
||||
"type": "module",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitea.hareworks.net/Hare/Decodal.git",
|
||||
"directory": "packages/decodal-codemirror"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/decodal.d.ts",
|
||||
"import": "./src/decodal.js"
|
||||
},
|
||||
"./parser": "./src/decodal-parser.js",
|
||||
"./terms": "./src/decodal-parser.terms.js"
|
||||
},
|
||||
"types": "./src/decodal.d.ts",
|
||||
"files": [
|
||||
"README.md",
|
||||
"src/"
|
||||
],
|
||||
"keywords": [
|
||||
"decodal",
|
||||
"codemirror",
|
||||
"lezer"
|
||||
],
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.12.4",
|
||||
"@lezer/highlight": "^1.2.3",
|
||||
"@lezer/lr": "^1.4.10"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
||||
import {LRParser} from "npm:@lezer/lr@^1.4.10"
|
||||
export const parser = LRParser.deserialize({
|
||||
version: 14,
|
||||
states: "7vQYQPOOO#nQPO'#CaOOQO'#Cr'#CrO$wQPO'#CyO&UQPO'#DOO&^QPO'#DSO&eQPO'#DWO&mQPO'#CqO$wQPO'#DcO&wQPO'#DhOOQO'#Cq'#CqOOQO'#Cp'#CpO&|QPO'#CoO$wQPO'#CoOOQO'#Cn'#CnO)fQPO'#CmO.XQPO'#ClO0]QPO'#CkOOQO'#Cj'#CjO2TQPO'#CiO3xQPO'#ChO5jQPO'#CgO7UQPO'#CfOOQO'#Ce'#CeO7`QPO'#C`O7eQPO'#C_OOQO'#Dz'#DzQYQPOOO8xQPO'#D{O8}QPO,58{OOQO,59e,59eO9VQPO'#CaOOQO,59j,59jO9_QPO,59jOOQO,59n,59nO9gQPO,59nO9oQPO'#EOO9tQPO'#DYO9|QPO,59rO:RQPO'#CqO:`QPO'#D^O:hQQO,59vO:mQPO,59vO:rQPO,59]O:wQPO,59}OOQO,5:S,5:SO:|QPO'#DjOOQO,59[,59[O;TQPO,59[OOQO,59Z,59ZO$wQPO,59YO$wQPO,59XO$wQPO,59WOOQO'#Dr'#DrO$wQPO,59VO$wQPO,59UO$wQPO,59T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$X$a$b!z_ORTVWk!O!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$T$U$V$W$X$`$a$b$f$g$h$i$j$k$lQ!x!TR#R$S#O^ORTVWk!O!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$lQ!R]R!w!S#T[ORTVW]k!O!S!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$l#TZORTVW]k!O!S!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$l#TYORTVW]k!O!S!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$lRvURzVQxVV#d!m#e#tQ#l!rV#|#w$O$RX#j!r#w$O$RR!P[R!u!OQ!WaQ$U$[R$f$dQkOR!`kSmPoR!bmQ!dqR#[!dQ!gsS#`!g#nR#n!sQuUR!juQ!nxR#f!nQ#x#lR$P#x",
|
||||
nodeNames: "⚠ Comment Source Statement FieldDefinition FieldPath Identifier Dot Equal Expression DefaultExpression PatchExpression ComposeExpression LogicalOrExpression LogicalAndExpression ComparisonExpression ConcatExpression AdditiveExpression MultiplicativeExpression UnaryExpression PostfixExpression PrimaryExpression Literal String Integer Float True False Regex ComparisonConstraint Lt Lte Gt Gte Object LBrace Semicolon RBrace Array LBracket Comma RBracket LetExpression Let FieldDefinitionList In FunctionExpression LParen ParameterList Parameter Colon RParen Arrow MatchExpression Match MatchArm Pattern Underscore ImportExpression Import CallSuffix ArgumentList Bang Minus Star Slash Plus PlusPlus CompareOperator EqualEqual BangEqual AmpAmp PipePipe Amp SlashSlash Default",
|
||||
maxTerm: 85,
|
||||
skippedNodes: [0,1],
|
||||
repeatNodeCount: 7,
|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#W9v#W#o,y~9{UU~!Q![,y!c!},y#R#S,y#T#[,y#[#]:_#]#o,y~:fS!W~U~!Q![,y!c!},y#R#S,y#T#o,y~:wUU~!Q![,y!c!},y#R#S,y#T#f,y#f#g;Z#g#o,y~;`UU~!Q![,y!c!},y#R#S,y#T#i,y#i#j;r#j#o,y~;wUU~!Q![,y!c!},y#R#S,y#T#X,y#X#Y<Z#Y#o,y~<bSj~U~!Q![,y!c!},y#R#S,y#T#o,y~<sOs~~<vP#p#q<y~=OO!j~~=TOu~",
|
||||
tokenizers: [0, 1],
|
||||
topRules: {"Source":[0,2]},
|
||||
tokenPrec: 2481
|
||||
})
|
||||
11
packages/decodal-codemirror/src/decodal.d.ts
vendored
11
packages/decodal-codemirror/src/decodal.d.ts
vendored
|
|
@ -1,11 +0,0 @@
|
|||
import { HighlightStyle } from '@codemirror/language';
|
||||
import { LRLanguage, LanguageSupport } from '@codemirror/language';
|
||||
|
||||
export declare const decodalLanguage: LRLanguage;
|
||||
export declare const decodalHighlightStyle: HighlightStyle;
|
||||
|
||||
export interface DecodalOptions {
|
||||
highlight?: boolean;
|
||||
}
|
||||
|
||||
export declare function decodal(options?: DecodalOptions): LanguageSupport;
|
||||
10
packages/decodal-codemirror/src/decodal.js.d.ts
vendored
10
packages/decodal-codemirror/src/decodal.js.d.ts
vendored
|
|
@ -1,10 +0,0 @@
|
|||
import { HighlightStyle, LRLanguage, LanguageSupport } from '@codemirror/language';
|
||||
|
||||
export declare const decodalLanguage: LRLanguage;
|
||||
export declare const decodalHighlightStyle: HighlightStyle;
|
||||
|
||||
export interface DecodalOptions {
|
||||
highlight?: boolean;
|
||||
}
|
||||
|
||||
export declare function decodal(options?: DecodalOptions): LanguageSupport;
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
import { HighlightStyle, LRLanguage, LanguageSupport, foldNodeProp, indentNodeProp, syntaxHighlighting } from 'npm:@codemirror/language@^6.12.4';
|
||||
import { styleTags, tags as t } from 'npm:@lezer/highlight@^1.2.3';
|
||||
import { parser } from './decodal-parser-jsr.js';
|
||||
|
||||
const parserWithMetadata = parser.configure({
|
||||
props: [
|
||||
styleTags({
|
||||
'Let In Match Import Default': t.keyword,
|
||||
'True False': t.bool,
|
||||
Identifier: t.variableName,
|
||||
String: t.string,
|
||||
Regex: t.regexp,
|
||||
'Integer Float': t.number,
|
||||
Comment: t.lineComment,
|
||||
'Plus Minus Star Slash PlusPlus Equal EqualEqual Bang BangEqual Amp AmpAmp PipePipe SlashSlash Gt Gte Lt Lte Arrow': t.operator,
|
||||
'LBrace RBrace': t.brace,
|
||||
'LBracket RBracket': t.squareBracket,
|
||||
'LParen RParen': t.paren,
|
||||
'Semicolon Comma Dot Colon': t.punctuation,
|
||||
}),
|
||||
indentNodeProp.add({
|
||||
Object: context => context.column(context.node.from) + context.unit,
|
||||
Array: context => context.column(context.node.from) + context.unit,
|
||||
MatchExpression: context => context.column(context.node.from) + context.unit,
|
||||
LetExpression: context => context.column(context.node.from) + context.unit,
|
||||
}),
|
||||
foldNodeProp.add({
|
||||
Object: foldDelimited('{', '}'),
|
||||
Array: foldDelimited('[', ']'),
|
||||
MatchExpression: foldDelimited('{', '}'),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
function foldDelimited(open: string, close: string) {
|
||||
return (node: { from: number; to: number }, state: { doc: { sliceString(from: number, to: number): string } }) => {
|
||||
const text = state.doc.sliceString(node.from, node.to);
|
||||
const openIndex = text.indexOf(open);
|
||||
const closeIndex = text.lastIndexOf(close);
|
||||
if (openIndex < 0 || closeIndex <= openIndex) return null;
|
||||
const from = node.from + openIndex + open.length;
|
||||
const to = node.from + closeIndex;
|
||||
return from < to ? { from, to } : null;
|
||||
};
|
||||
}
|
||||
|
||||
export const decodalLanguage: LRLanguage = LRLanguage.define({
|
||||
parser: parserWithMetadata,
|
||||
languageData: {
|
||||
commentTokens: { line: '#' },
|
||||
closeBrackets: { brackets: ['(', '[', '{', '"'] },
|
||||
},
|
||||
});
|
||||
|
||||
export const decodalHighlightStyle: HighlightStyle = HighlightStyle.define([
|
||||
{ tag: t.keyword, color: '#93c5fd', fontWeight: '700' },
|
||||
{ tag: t.variableName, color: 'inherit' },
|
||||
{ tag: t.bool, color: '#fbbf24' },
|
||||
{ tag: t.number, color: '#fbbf24' },
|
||||
{ tag: t.string, color: '#86efac' },
|
||||
{ tag: t.regexp, color: '#86efac' },
|
||||
{ tag: t.lineComment, color: '#94a3b8', fontStyle: 'italic' },
|
||||
{ tag: t.operator, color: '#f9a8d4' },
|
||||
{ tag: [t.brace, t.squareBracket, t.paren, t.punctuation], color: '#f9a8d4' },
|
||||
]);
|
||||
|
||||
export interface DecodalOptions {
|
||||
highlight?: boolean;
|
||||
}
|
||||
|
||||
export function decodal(options: DecodalOptions = {}): LanguageSupport {
|
||||
const { highlight = true } = options;
|
||||
return new LanguageSupport(
|
||||
decodalLanguage,
|
||||
highlight ? [syntaxHighlighting(decodalHighlightStyle)] : [],
|
||||
);
|
||||
}
|
||||
|
|
@ -2,9 +2,4 @@ import { defineConfig } from 'astro/config';
|
|||
|
||||
export default defineConfig({
|
||||
output: 'static',
|
||||
vite: {
|
||||
resolve: {
|
||||
preserveSymlinks: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
15
site/decodal-site/package-lock.json
generated
15
site/decodal-site/package-lock.json
generated
|
|
@ -10,12 +10,12 @@
|
|||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.4",
|
||||
"@codemirror/language": "^6.12.4",
|
||||
"@codemirror/state": "^6.7.1",
|
||||
"@codemirror/view": "^6.43.6",
|
||||
"@lezer/highlight": "^1.2.3",
|
||||
"@lezer/lr": "^1.4.10",
|
||||
"astro": "^4.16.18",
|
||||
"codemirror": "^6.0.2",
|
||||
"decodal-codemirror": "file:../../packages/decodal-codemirror",
|
||||
"marked": "^12.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -23,15 +23,6 @@
|
|||
"wrangler": "^4.104.0"
|
||||
}
|
||||
},
|
||||
"../../packages/decodal-codemirror": {
|
||||
"version": "0.1.2",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.12.4",
|
||||
"@lezer/highlight": "^1.2.3",
|
||||
"@lezer/lr": "^1.4.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/check": {
|
||||
"version": "0.9.9",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.9.9.tgz",
|
||||
|
|
@ -3246,10 +3237,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/decodal-codemirror": {
|
||||
"resolved": "../../packages/decodal-codemirror",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/decode-named-character-reference": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz",
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@
|
|||
"dependencies": {
|
||||
"@astrojs/check": "^0.9.4",
|
||||
"@codemirror/language": "^6.12.4",
|
||||
"@codemirror/state": "^6.7.1",
|
||||
"@codemirror/view": "^6.43.6",
|
||||
"@lezer/highlight": "^1.2.3",
|
||||
"@lezer/lr": "^1.4.10",
|
||||
"astro": "^4.16.18",
|
||||
"codemirror": "^6.0.2",
|
||||
"decodal-codemirror": "file:../../packages/decodal-codemirror",
|
||||
"marked": "^12.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { nav } from '../lib/docs.js';
|
||||
import '../style.css';
|
||||
|
||||
const { title = 'Decodal', active = '', playground = false, frontpage = false } = Astro.props;
|
||||
const { title = 'Decodal', active = '', playground = false } = Astro.props;
|
||||
|
||||
function renderNav(items, prefix = []) {
|
||||
return `<ul class="nav-tree">${items
|
||||
|
|
@ -25,27 +25,22 @@ function renderNav(items, prefix = []) {
|
|||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
<a class="brand" href="/">Decodal</a>
|
||||
<a class="brand" href="/docs/introduction/">Decodal</a>
|
||||
<nav class="topnav">
|
||||
<a href="/docs/introduction/">Docs</a>
|
||||
<a href="/playground/">Playground</a>
|
||||
<a href="https://gitea.hareworks.net/Hare/Decodal">Source</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class={playground || frontpage ? 'layout playground-layout' : 'layout'}>
|
||||
{!playground && !frontpage && (
|
||||
<div class={playground ? 'layout playground-layout' : 'layout'}>
|
||||
{!playground && (
|
||||
<aside class="sidebar">
|
||||
<a class="sidebar-title" href="/docs/">Manual</a>
|
||||
<nav set:html={renderNav(nav)} />
|
||||
</aside>
|
||||
)}
|
||||
<main class={playground ? 'playground' : frontpage ? 'frontpage' : ''}>
|
||||
<main class={playground ? 'playground' : ''}>
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
<footer class="site-footer">
|
||||
<span>2026 Hare</span>
|
||||
<a href="https://gitea.hareworks.net/Hare/Decodal">Source</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -64,10 +64,6 @@ export const decodalHighlightStyle = HighlightStyle.define([
|
|||
{ tag: [t.brace, t.squareBracket, t.paren, t.punctuation], color: '#f9a8d4' },
|
||||
]);
|
||||
|
||||
export function decodal(options = {}) {
|
||||
const { highlight = true } = options;
|
||||
return new LanguageSupport(
|
||||
decodalLanguage,
|
||||
highlight ? [syntaxHighlighting(decodalHighlightStyle)] : [],
|
||||
);
|
||||
export function decodal() {
|
||||
return new LanguageSupport(decodalLanguage, [syntaxHighlighting(decodalHighlightStyle)]);
|
||||
}
|
||||
|
|
@ -1,89 +1,3 @@
|
|||
---
|
||||
import ManualLayout from '../layouts/ManualLayout.astro';
|
||||
|
||||
const example = `Port = Int >= 1 & <= 65535 default 8080;
|
||||
|
||||
Server = {
|
||||
host = String default "localhost";
|
||||
port = Port;
|
||||
};
|
||||
|
||||
Production = Server & {
|
||||
host = "example.com";
|
||||
};`;
|
||||
return Astro.redirect('/docs/introduction/');
|
||||
---
|
||||
<ManualLayout title="Decodal" frontpage>
|
||||
<section class="hero">
|
||||
<h1>Decodal keeps configuration, constraints, and defaults in one composable value.</h1>
|
||||
<p class="hero-copy">
|
||||
Define structured data with constraints, compose it with patches, and materialize the result from Rust,
|
||||
WebAssembly, or the browser playground.
|
||||
</p>
|
||||
<div class="hero-actions">
|
||||
<a class="button primary" href="/playground/">Try the playground</a>
|
||||
<a class="button secondary" href="/docs/introduction/">Read the manual</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="home-packages" aria-label="Official packages">
|
||||
<h2>Official packages</h2>
|
||||
<div class="package-links">
|
||||
<a href="https://crates.io/crates/decodal">
|
||||
<span>Rust crate</span>
|
||||
<strong>crates.io/crates/decodal</strong>
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/decodal-wasm">
|
||||
<span>npm package</span>
|
||||
<strong>npmjs.com/package/decodal-wasm</strong>
|
||||
</a>
|
||||
<a href="https://jsr.io/@hare/decodal-wasm@0.1.2">
|
||||
<span>JSR package</span>
|
||||
<strong>jsr.io/@hare/decodal-wasm</strong>
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/decodal-codemirror">
|
||||
<span>CodeMirror package</span>
|
||||
<strong>npmjs.com/package/decodal-codemirror</strong>
|
||||
</a>
|
||||
<a href="https://jsr.io/@hare/decodal-codemirror@0.1.2">
|
||||
<span>CodeMirror on JSR</span>
|
||||
<strong>jsr.io/@hare/decodal-codemirror</strong>
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="home-grid" aria-label="Decodal overview">
|
||||
<article class="home-card">
|
||||
<h2>What it is</h2>
|
||||
<p>
|
||||
Decodal is a small data language for configuration shapes that need validation, defaults,
|
||||
lazy imports, and predictable composition.
|
||||
</p>
|
||||
</article>
|
||||
<article class="home-card">
|
||||
<h2>Where it runs</h2>
|
||||
<p>
|
||||
Use the Rust crate for runtime embedding, the WASM package in browsers, CodeMirror/Lezer for the Web editor,
|
||||
and Tree-sitter for general editor integration.
|
||||
</p>
|
||||
</article>
|
||||
<article class="home-card">
|
||||
<h2>Start here</h2>
|
||||
<p>
|
||||
Open the playground to run examples in your browser, or read the components page to see how the runtime and
|
||||
editor pieces fit together.
|
||||
</p>
|
||||
<p><a href="/docs/components/">View components →</a></p>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="home-example" aria-label="Decodal example">
|
||||
<div>
|
||||
<h2>A compact example</h2>
|
||||
<p>
|
||||
Constraints and defaults are values. Compose them with concrete data and materialize when the host knows what
|
||||
output shape it expects.
|
||||
</p>
|
||||
</div>
|
||||
<pre><code>{example}</code></pre>
|
||||
</section>
|
||||
</ManualLayout>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import init, { evaluateProject } from '../wasm/decodal_wasm.js';
|
||||
import { EditorView, basicSetup } from 'codemirror';
|
||||
import { keymap } from '@codemirror/view';
|
||||
import { decodal } from 'decodal-codemirror';
|
||||
import { decodal } from '../lib/codemirror/decodal.js';
|
||||
import { playgroundExamples } from './playground-examples.js';
|
||||
|
||||
const STORAGE_KEY = 'decodal-playground-project-v1';
|
||||
|
|
|
|||
|
|
@ -89,21 +89,10 @@ a:hover {
|
|||
color: var(--topbar-link);
|
||||
}
|
||||
|
||||
.site-footer {
|
||||
align-items: center;
|
||||
border-top: 1px solid var(--border);
|
||||
color: var(--subtle);
|
||||
display: flex;
|
||||
font-size: 0.9rem;
|
||||
gap: 14px;
|
||||
justify-content: center;
|
||||
padding: 15px 24px;
|
||||
}
|
||||
|
||||
.layout {
|
||||
display: grid;
|
||||
grid-template-columns: 300px minmax(0, 1fr);
|
||||
min-height: calc(100vh - 104px);
|
||||
min-height: calc(100vh - 56px);
|
||||
}
|
||||
|
||||
.playground-layout {
|
||||
|
|
@ -469,130 +458,6 @@ button:disabled {
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.frontpage {
|
||||
max-width: 1120px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.hero {
|
||||
padding: 5rem 0 4rem;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: clamp(2.4rem, 6vw, 5rem);
|
||||
line-height: 0.95;
|
||||
letter-spacing: -0.06em;
|
||||
margin: 0;
|
||||
max-width: 950px;
|
||||
}
|
||||
|
||||
.hero-copy {
|
||||
color: var(--muted);
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.7;
|
||||
max-width: 760px;
|
||||
margin: 1.5rem 0 0;
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.9rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.button {
|
||||
border-radius: 999px;
|
||||
font-weight: 700;
|
||||
padding: 0.8rem 1.15rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.button.primary {
|
||||
background: var(--link);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.button.secondary {
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.home-packages {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 18px;
|
||||
margin-bottom: 1.5rem;
|
||||
padding: 1.4rem;
|
||||
}
|
||||
|
||||
.home-packages h2 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.package-links {
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.package-links a {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
display: block;
|
||||
padding: 1rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.package-links span {
|
||||
color: var(--muted);
|
||||
display: block;
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: 0.3rem;
|
||||
}
|
||||
|
||||
.package-links strong {
|
||||
color: var(--text);
|
||||
display: block;
|
||||
font-size: 0.95rem;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.home-grid {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.home-card,
|
||||
.home-example {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 18px;
|
||||
padding: 1.4rem;
|
||||
}
|
||||
|
||||
.home-card h2,
|
||||
.home-example h2 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.home-card p:last-child,
|
||||
.home-example p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.home-example {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
|
||||
}
|
||||
|
||||
.home-example pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.layout {
|
||||
grid-template-columns: 1fr;
|
||||
|
|
@ -602,13 +467,7 @@ button:disabled {
|
|||
border-right: 0;
|
||||
max-height: 260px;
|
||||
}
|
||||
.playground-shell,
|
||||
.home-grid,
|
||||
.home-example,
|
||||
.package-links {
|
||||
.playground-shell {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.hero {
|
||||
padding-top: 3rem;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"name": "@hare/decodal-wasm",
|
||||
"version": "0.1.2",
|
||||
"license": "MIT",
|
||||
"exports": "./decodal_wasm.js",
|
||||
"publish": {
|
||||
"include": [
|
||||
"README.md",
|
||||
"decodal_wasm.js",
|
||||
"decodal_wasm.d.ts",
|
||||
"decodal_wasm_bg.wasm",
|
||||
"package.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "decodal-wasm",
|
||||
"type": "module",
|
||||
"description": "WebAssembly wrapper for evaluating Decodal in browser playgrounds.",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.1",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user