From cc219d714960ed68d2a822cd98bb428c32b71e1f Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Sun, 3 Oct 2021 16:40:08 +0100 Subject: Add CUDL definition documents --- example.cudl | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 example.cudl (limited to 'example.cudl') diff --git a/example.cudl b/example.cudl new file mode 100644 index 0000000..3ee0ab6 --- /dev/null +++ b/example.cudl @@ -0,0 +1,65 @@ +# Without a schema + +{ + people: [{ + name: "Jack Smith" + sequence: [2 1 3 4 7 11 18 29 47] + language: "zig" + "hello world":| + """ + const std = @import("std"); + + pub fn main() !void { + const stdout = try std.io.getStdOut(); + try stdout.write("hello world\n"); + } + """ + "is me": %true + } { + name: "John Doe" + sequence: [2 3 5 7 11 13 17 19 23] + language: "C" + "hello world":| + """ + int puts(const char *s); + + int main(int argc, char *argv[]) { + puts("hello world"); + return 0; + } + """ + "is me": %false + }] +} + +# With a schema + +people: [ + name: Jack Smith + sequence: [2 1 3 4 7 11 18 29 47] + language: zig + "hello world":| + """ + const std = @import("std"); + + pub fn main() !void { + const stdout = try std.io.getStdOut(); + try stdout.write("hello world\n"); + } + """ + "is me": %true + ; + name: John Doe + sequence: [2 3 5 7 11 13 17 19 23] + language: C + "hello world":| + """ + int puts(const char *s); + + int main(int argc, char *argv[]) { + puts("hello world"); + return 0; + } + """ + "is me": %false +] -- cgit v1.2.3