Initial commit: Pugz - Pug-like HTML template engine in Zig
Features: - Lexer with indentation tracking and raw text block support - Parser producing AST from token stream - Runtime with variable interpolation, conditionals, loops - Mixin support (params, defaults, rest args, block content, attributes) - Template inheritance (extends/block/append/prepend) - Plain text (piped, dot blocks, literal HTML) - Tag interpolation (#[tag text]) - Block expansion with colon - Self-closing tags (void elements + explicit /) - Case/when statements - Comments (rendered and silent) All 113 tests passing.
This commit is contained in:
18
src/tests/mixin_debug_test.zig
Normal file
18
src/tests/mixin_debug_test.zig
Normal file
@@ -0,0 +1,18 @@
|
||||
const std = @import("std");
|
||||
const pugz = @import("pugz");
|
||||
|
||||
test "debug mixin tokens" {
|
||||
const allocator = std.testing.allocator;
|
||||
|
||||
const template = "+pet('cat')";
|
||||
|
||||
var lexer = pugz.Lexer.init(allocator, template);
|
||||
defer lexer.deinit();
|
||||
|
||||
const tokens = try lexer.tokenize();
|
||||
|
||||
std.debug.print("\n=== Tokens for: {s} ===\n", .{template});
|
||||
for (tokens, 0..) |tok, i| {
|
||||
std.debug.print("{d}: {s} = '{s}'\n", .{i, @tagName(tok.type), tok.value});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user