diff --git a/src/lib/compile_unit.h b/src/lib/compile_unit.h new file mode 100644 index 0000000..e69de29 diff --git a/test/dtree.uce b/test/dtree.uce new file mode 100644 index 0000000..053641b --- /dev/null +++ b/test/dtree.uce @@ -0,0 +1,54 @@ + + +RENDER() +{ + DTree t; + + <> + +
+
+ t.set("string test");
+ echo(string("string test: ") + t.to_string()+"\n");
+
+ t.set(true);
+ echo(string("bool test: ") + t.to_string()+"\n");
+
+ t.set(1234.5678);
+ echo(string("float test: ") + t.to_string()+"\n");
+
+ t.set(&t);
+ echo(string("pointer test: ") + t.to_string()+"\n");
+
+ ?>
+
+ Tree:
+
+
+
+ t.key("a")->set("valueA");
+ t.key("b")->set("valueB");
+ t.key("c")->key("c-d")->set("valueCD");
+ t.key("c")->key("c-e")->set("valueCE");
+ t.key("c")->key("c-f")->set(&t);
+ t.key("g")->key("g-h")->key("h-i")->set("valueHI");
+ t["g"]["x"]["y1"] = "XYZ1";
+ t["g"]["x"]["y2"] = &t;
+ t["g"]["x"]["y3"] = time();
+ t["g"]["x"]["y4"] = "Ünicödä";
+ echo(var_dump(t));
+
+ ?>
+
+ Params
+ = var_dump(context->params) ?>+ > + +} diff --git a/test/json.uce b/test/json.uce new file mode 100644 index 0000000..ecdf0ce --- /dev/null +++ b/test/json.uce @@ -0,0 +1,44 @@ + + +RENDER() +{ + DTree t; + + <> + +
+
+ t.key("a")->set("valueA");
+ t.key("b")->set("valueB");
+ t.key("c")->key("c-d")->set("valueCD");
+ t.key("c")->key("c-e")->set("valueCE");
+ t.key("c")->key("c-f")->set(&t);
+ t.key("g")->key("g-h")->key("h-i")->set("valueHI");
+ t["g"]["x"]["y1"] = "XYZ1";
+ t["g"]["x"]["y2"] = &t;
+ t["g"]["x"]["y3"] = time();
+ t["g"]["x"]["y4"] = "Ünicödä";
+
+ string j;
+ echo(j = json_encode(t));
+
+ ?>
+
+ Parsed:
+
+
+ echo(var_dump(json_decode("1")));
+ ?>
+
+ Params
+ = var_dump(context->params) ?>+ > + +}