From f80f005c602654abe137f152a5128c8abd81f9a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20L=2E=20=C5=A0ijanec?= Date: Sun, 3 May 2020 21:00:05 +0200 Subject: variables setting and getting now works from bvr scripts note to future self: don't make this a turing complete language --- test/ram-test.c | 6 ++++++ test/tape-test.bvr | 21 ++++++++++++++++----- test/tape-test.c | 7 ++++++- test/var-test.c | 9 +++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 test/ram-test.c create mode 100644 test/var-test.c (limited to 'test') diff --git a/test/ram-test.c b/test/ram-test.c new file mode 100644 index 0000000..8ef0aa2 --- /dev/null +++ b/test/ram-test.c @@ -0,0 +1,6 @@ +#include +int ram_contents[1024]; +int main(int argc, char * argv[]) { + printf("%s\n", ram_contents); + return 0; +} diff --git a/test/tape-test.bvr b/test/tape-test.bvr index c965bc1..f91ceca 100644 --- a/test/tape-test.bvr +++ b/test/tape-test.bvr @@ -1,7 +1,18 @@ -<@?s post_author anton@> +<@?s abc 1232@> +<@?g abc@> +<@?g abc@> +<@?s abc 123@> +<@?g abc@> +<@?g abc@> +<@?s ab 12@> +<@?g ab@> +<@?g ab@> # to je komentar in se ne rendera -<@?i h1@> -<@?s image_caption This is an example image.@> -<@?s example.jpg@> -<@?i image@> +<@?1 post_author@> +<@?2 image_caption This is an example image.@> +<@?3 sexample.jpg@> +<@#?4 image@> +<@?5 image@> +<@?6 image@> +<@?7 image@> in tako so srečno živeli do konca svojih dni! diff --git a/test/tape-test.c b/test/tape-test.c index f1cca25..fc1b2e5 100644 --- a/test/tape-test.c +++ b/test/tape-test.c @@ -6,5 +6,10 @@ extern int main(int argc, char* argv[]) { printf("usage: %s source-file file-with-commands-replaced-with-a's\n", argv[0]); return 1; } - return bvr_compose_page(argv[1], 0, argv[2]); + // bvr_var_set("abc", "1234"); + // bvr_var_set("ab", "123"); + // printf("%s\n", bvr_var_get("abc")); + // printf("%s\n", bvr_var_get("ab")); + bvr_compose_page(argv[1], 0, argv[2]); + return 1; } diff --git a/test/var-test.c b/test/var-test.c new file mode 100644 index 0000000..8c40d85 --- /dev/null +++ b/test/var-test.c @@ -0,0 +1,9 @@ +#include +#include +#include + +int main(int argc, char * argv[]) { + bvr_var_set("abc", "1232"); + printf("%s\n", bvr_var_get("abc")); + return 0; +} -- cgit v1.2.3