buildGrammar() — astro Function Reference
Architecture documentation for the buildGrammar() function in build-grammar.mjs from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 1a131d43_87c7_fb43_36b0_04d6330bf43a["buildGrammar()"] 4b5bb71e_3e72_6bf4_51bf_81a3e53f2ebb["build-grammar.mjs"] 1a131d43_87c7_fb43_36b0_04d6330bf43a -->|defined in| 4b5bb71e_3e72_6bf4_51bf_81a3e53f2ebb style 1a131d43_87c7_fb43_36b0_04d6330bf43a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/language-tools/vscode/scripts/build-grammar.mjs lines 38–45
function buildGrammar(grammarFile) {
const grammar = yaml.load(fs.readFileSync(grammarFile, 'utf8'));
const finalPath = fileURLToPath(grammarFile).replace('.src.yaml', '.json');
fs.writeFileSync(finalPath, JSON.stringify(grammar, null, 2));
const date = dt.format(new Date());
console.info(dim(`[${date}] `) + green(`✔ updated ${finalPath}`));
}
Domain
Subdomains
Source
Frequently Asked Questions
What does buildGrammar() do?
buildGrammar() is a function in the astro codebase, defined in packages/language-tools/vscode/scripts/build-grammar.mjs.
Where is buildGrammar() defined?
buildGrammar() is defined in packages/language-tools/vscode/scripts/build-grammar.mjs at line 38.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free