beta/code-blocks (#1)

Reviewed-on: #1
Co-authored-by: obvTiger <obvtiger@epilogue.team>
Co-committed-by: obvTiger <obvtiger@epilogue.team>
This commit is contained in:
obvTiger 2025-04-01 15:22:15 +02:00 committed by obvtiger
parent 362b7aa15e
commit d125640fe7
26 changed files with 1816 additions and 102 deletions

View file

@ -129,6 +129,41 @@ class ASTBuilder {
);
}
if (token.type === "client" || token.type === "server") {
if (this.options.debug) {
console.log(
`\n[ASTBuilder] Processing ${token.type} block at line ${token.line}, column ${token.column}`
);
}
const node = {
type: token.type,
script: token.value,
line: token.line,
column: token.column,
};
if (token.type === "server" && token.params) {
node.params = token.params;
if (this.options.debug) {
console.log(
`[ASTBuilder] Server block parameters: ${node.params.join(", ")}`
);
}
}
if (this.options.debug) {
console.log(`[ASTBuilder] Created node for ${token.type} block`);
console.log(
"[ASTBuilder] Script content (first 50 chars):",
node.script.substring(0, 50) + (node.script.length > 50 ? "..." : "")
);
}
current++;
return node;
}
if (token.type === "identifier") {
if (this.options.debug) {
console.log(