diff --git a/src/template/lib.zig b/src/template/lib.zig
index 029d921..413cc53 100644
--- a/src/template/lib.zig
+++ b/src/template/lib.zig
@@ -17,6 +17,7 @@ pub fn main() !void {
.quxx = true,
.maybe_foo = @as(?[]const u8, "foo"),
.maybe_bar = @as(?[]const u8, null),
+ .x = "y",
},
.{
.context_foo = "foo",
@@ -658,7 +659,7 @@ fn parseDeref(comptime tokens: ControlTokenIter) ParseResult(ControlTokenIter, [
if (wants != .period) @compileError("Unexpected token \".\"");
wants = .text;
},
- else => if (wants == .period) return .{
+ else => if (wants == .period or fields.len == 0) return .{
.new_iter = iter,
.item = fields,
} else @compileError("Unexpected token"),
diff --git a/src/template/test.tmp.html b/src/template/test.tmp.html
index f6e12b3..aa0100a 100644
--- a/src/template/test.tmp.html
+++ b/src/template/test.tmp.html
@@ -27,6 +27,7 @@
{#if .maybe_foo |$_|}abcd{#else}null{/if}
{#template test_tmpl .bar}
+ {#template test_tmpl .}
{@context_foo}