aboutsummaryrefslogtreecommitdiff
path: root/tests/d.ek
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-11-01 00:18:36 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2023-11-01 00:18:36 +0200
commitbb560b4201d8b813ed3999250845f365ff9d6c50 (patch)
treece83ca11d065d42629d7837ed3b8c5d50bb0b55e /tests/d.ek
parentfed864bf018e7d97fda24089ebe08fa0da1c3b97 (diff)
downloadek-bb560b4201d8b813ed3999250845f365ff9d6c50.tar.gz
ek-bb560b4201d8b813ed3999250845f365ff9d6c50.zip
more tweaks to syntax
Diffstat (limited to 'tests/d.ek')
-rw-r--r--tests/d.ek35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/d.ek b/tests/d.ek
new file mode 100644
index 0000000..1ee313d
--- /dev/null
+++ b/tests/d.ek
@@ -0,0 +1,35 @@
+struct vec[any T]
+{
+ u27 size;
+ u27 cap;
+ *T buf;
+}
+
+append(*vec v, T::typeof(v) e)
+{
+ if v.size == v.cap {
+ v.cap *= 3;
+ v.buf = realloc(v.buf, v.cap);
+ }
+ u27 a = {
+ 2
+ };
+
+ {
+ here();
+ }
+
+ u27 a = {
+ .what = 200,
+ .wow = 200
+ };
+
+ u27 a = switch (b) {
+ default: 20;
+ };
+
+ label: while a {
+ }
+
+ v.buf[v.size] = e;
+}