Files
rspade_system/node_modules/@jqhtml/parser/dist/ast.js
2025-12-12 07:19:23 +00:00

30 lines
1.0 KiB
JavaScript
Executable File

// AST Node Types for JQHTML Templates
// Simple, clear node structures for the syntax tree
export var NodeType;
(function (NodeType) {
NodeType["PROGRAM"] = "Program";
NodeType["COMPONENT_DEFINITION"] = "ComponentDefinition";
NodeType["COMPONENT_INVOCATION"] = "ComponentInvocation";
NodeType["HTML_TAG"] = "HtmlTag";
NodeType["TEXT"] = "Text";
NodeType["EXPRESSION"] = "Expression";
NodeType["IF_STATEMENT"] = "IfStatement";
NodeType["FOR_STATEMENT"] = "ForStatement";
NodeType["CODE_BLOCK"] = "CodeBlock";
NodeType["FRAGMENT"] = "Fragment";
NodeType["SLOT"] = "Slot";
NodeType["CONDITIONAL_ATTRIBUTE"] = "ConditionalAttribute"; // Conditional attribute: <% if (cond) { %>attr="val"<% } %>
})(NodeType || (NodeType = {}));
// Helper to create nodes with common properties
export function createNode(type, props, start, end, line, column, loc) {
return {
type,
start,
end,
line,
column,
loc,
...props
};
}
//# sourceMappingURL=ast.js.map