config: migrate workspace evaluation to Decodal 0.4

This commit is contained in:
2026-08-14 10:53:22 +09:00
parent 5c57e10de9
commit 1fad5fc8ed
12 changed files with 498 additions and 37 deletions
@@ -0,0 +1,23 @@
import { decodalLanguage } from "decodal-codemirror";
Deno.test("editor grammar accepts Decodal 0.4 schema syntax", () => {
const source = `
import "main.dcdl" as WorkspaceConfigSchema
{
features = {...{ enabled = Bool; }};
web = { enabled = Bool; ...Unknown };
}
`;
const tree = decodalLanguage.parser.parse(source);
const errors: string[] = [];
tree.iterate({
enter(node) {
if (node.type.isError) {
errors.push(`${node.from}..${node.to}`);
}
},
});
if (errors.length > 0) {
throw new Error(`Decodal 0.4 grammar produced parse errors at ${errors.join(", ")}`);
}
});