From 4adc90d9a8e48a5c1841874cae0cb30c3deee6e1 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 20 Sep 2020 18:18:26 -0400 Subject: Basic updates - Move preprocessor to it's own file - Begin working on new delimiters - Begin working on blocks in the tree --- tests/block-test.tnsl | 29 +++++++++++------------------ tests/comment-test.tnsl | 16 ++++++++++++---- tests/literal-test.tnsl | 4 ++-- tests/parameter-test.tnsl | 2 ++ tests/run-tests.sh | 3 +++ 5 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 tests/parameter-test.tnsl (limited to 'tests') diff --git a/tests/block-test.tnsl b/tests/block-test.tnsl index a05ca60..e5c3aaf 100644 --- a/tests/block-test.tnsl +++ b/tests/block-test.tnsl @@ -1,33 +1,26 @@ -;int i = 0 - /;if (i==0) ;i = 2 - ;/ -/;else - ;i = 0 -;/ +/: import + "this" + "that" +:/ # ;; can be used as a quick block re-definition /;if (i==0) ;i = 2 - ;;else ;i = 0 - ;/ -/;if - ;char ch = '\n' - -;;else - ;int it = 90 - -;/ +# Comment block switching -/;main - ; - +/; if (i == 2) + ;i = 4 +;# + Comment +#; else + ;i = 6 ;/ \ No newline at end of file diff --git a/tests/comment-test.tnsl b/tests/comment-test.tnsl index fe07b45..cdd33be 100644 --- a/tests/comment-test.tnsl +++ b/tests/comment-test.tnsl @@ -11,12 +11,20 @@ a/# Ok, so this should give no output either #/ -#; +# ; #a # /; -;# +; # stuff a# /;# -#;/ -;/ \ No newline at end of file +# ;/ +;/ + +# More intricate block changing checks + +/# Comment start +Comment end #; if (thing) +;; else if (other_thing) +;# Comment start +End #/ \ No newline at end of file diff --git a/tests/literal-test.tnsl b/tests/literal-test.tnsl index b447e57..e3b73da 100644 --- a/tests/literal-test.tnsl +++ b/tests/literal-test.tnsl @@ -1,6 +1,6 @@ # These should all work -;string s = "\"" -;string st="\\" +;[]char s = "\"" +;[]char st="\\" ;int i = 0 ;int j=1 diff --git a/tests/parameter-test.tnsl b/tests/parameter-test.tnsl new file mode 100644 index 0000000..c969427 --- /dev/null +++ b/tests/parameter-test.tnsl @@ -0,0 +1,2 @@ +/; loop (int initial = 0, int complex = 2) [initial < max || complex < 40, initial++, complex += 7, another += 2] +;/ diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 0bc57b0..6f49335 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -12,4 +12,7 @@ PARSEFILE=comment parse PARSEFILE=literal +parse + +PARSEFILE=parameter parse \ No newline at end of file -- cgit v1.2.3