From 4b6f66fd512c254b5a82220dc77411fe391dd258 Mon Sep 17 00:00:00 2001 From: David Czihak Date: Sat, 9 May 2026 13:01:50 +0200 Subject: Chore: Rework examples for thorough extension testing --- examples/zon-examples/full-types.zon | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 examples/zon-examples/full-types.zon (limited to 'examples/zon-examples/full-types.zon') diff --git a/examples/zon-examples/full-types.zon b/examples/zon-examples/full-types.zon new file mode 100644 index 0000000..5a06044 --- /dev/null +++ b/examples/zon-examples/full-types.zon @@ -0,0 +1,74 @@ +// ZON full-type showcase — exercises all value forms the ZON grammar supports. +// Open in Nova to verify syntax highlighting across every literal kind. +.{ + // String (double-quoted) + .name = "nova-zig-full", + + // Integers — decimal, hex, octal, binary, with digit separators + .decimal = 42, + .hex = 0xFF, + .octal = 0o77, + .binary = 0b1010_1010, + .large = 1_000_000, + + // Floats + .pi = 3.14159, + .scientific = 1.5e10, + .negative_float = -0.001, + + // Booleans + .flag_on = true, + .flag_off = false, + + // Null + .optional = null, + + // Enum tag / identifier literal (dot-prefixed) + .level = .info, + .theme = .solarized, + + // Negative integer + .offset = -7, + + // Nested struct + .metadata = .{ + .author = "David", + .year = 2025, + .prerelease = false, + }, + + // Array of strings + .targets = .{ + "x86_64-linux", + "aarch64-macos", + "wasm32-wasi", + }, + + // Array of nested structs + .rules = .{ + .{ .name = "lint", .enabled = true }, + .{ .name = "format", .enabled = false }, + .{ .name = "test", .enabled = true }, + }, + + // Deeply nested + .config = .{ + .server = .{ + .host = "localhost", + .port = 8080, + .tls = .{ + .enabled = false, + .cert = null, + }, + }, + }, + + // Unicode string + .label = "Zig \u{2744} Nova", + + // Empty struct + .empty = .{}, + + // Empty array + .no_items = .{}, +} -- cgit v1.3