refactor: migrate legacy wire namespace to wrn
This commit is contained in:
@@ -33,7 +33,7 @@ for (const rel of [
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Grammar wires up the right scope + embedded languages.
|
||||
// 2. Grammar connects up the right scope + embedded languages.
|
||||
const grammar = JSON.parse(readFileSync(join(root, "syntaxes/wrn.tmLanguage.json"), "utf8"));
|
||||
grammar.scopeName === "source.wrn" ? ok("grammar scopeName") : bad("grammar scopeName");
|
||||
|
||||
@@ -121,7 +121,7 @@ try {
|
||||
try {
|
||||
const compiler = require(join(root, "src/compiler.cjs"));
|
||||
const good = `page Home {\n view { <h1>Hi</h1> }\n}`;
|
||||
compiler.compileWireFile(good);
|
||||
compiler.compileWrnFile(good);
|
||||
ok("compiler accepts valid .wrn");
|
||||
|
||||
const structuredProps = `page FooterExample {
|
||||
@@ -140,13 +140,13 @@ try {
|
||||
/>
|
||||
}
|
||||
}`;
|
||||
compiler.compileWireFile(structuredProps);
|
||||
compiler.compileWrnFile(structuredProps);
|
||||
ok("compiler accepts native structured state and unquoted prop expressions");
|
||||
|
||||
const badSrc = `page Home {\n view { <h1>Hi</h2> }\n}`;
|
||||
let threw = false;
|
||||
try {
|
||||
compiler.compileWireFile(badSrc);
|
||||
compiler.compileWrnFile(badSrc);
|
||||
} catch (e) {
|
||||
threw = true;
|
||||
/offset\s+\d+|end of input/.test(e.message)
|
||||
|
||||
Reference in New Issue
Block a user