From 1100ac865074effb3a4735c7449779f7193b7d0c Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 3 Dec 2021 18:25:03 -0500 Subject: General updates + Fill out eval a little and make sure that this builds. ~ CF kinda broken in AST. Gonna have to fix that. Upcoming Parser update. --- tests/block-test.tnsl | 18 ++++++++---------- tests/comment-test.tnsl | 14 ++++++++------ tests/literal-test.tnsl | 10 ++++++---- tests/parameter-test.tnsl | 2 +- tests/statement-test.tnsl | 2 +- 5 files changed, 24 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/block-test.tnsl b/tests/block-test.tnsl index c48d7de..2bd4053 100644 --- a/tests/block-test.tnsl +++ b/tests/block-test.tnsl @@ -22,10 +22,8 @@ ;i = 2 ;/ - /: include - "this" - "that" - :/ + :include "this" + :include "that" # ;; can be used as a quick block re-definition @@ -53,17 +51,17 @@ /;method Vector2 /; operator + (~Vector2 v) - ;self.x += v`.x - ;self.y += v`.y + ;self.x = self.x + v`.x + ;self.y = self.y + v`.y ;/ /; operator + (int32 a) - ;self.x += a - ;self.y += a + ;self.x = self.x + a + ;self.y = self.y + a ;/ ;/ - ;struct FVector2 () {} + ;struct FVector2 () {float x, y} -;/ \ No newline at end of file +;/ diff --git a/tests/comment-test.tnsl b/tests/comment-test.tnsl index 6643695..ffc6e3a 100644 --- a/tests/comment-test.tnsl +++ b/tests/comment-test.tnsl @@ -14,14 +14,16 @@ limitations under the License. #/ -;/# -#/; +/;/# +#/;/ + +;a a -a/# +;a/# #/a -/;/# -#/;/ +; /# +#/; /# Ok, so this should give no output either @@ -43,4 +45,4 @@ a# Comment end #; if (thing) ;; else if (other_thing) ;# Comment start -End #/ \ No newline at end of file +End #/ diff --git a/tests/literal-test.tnsl b/tests/literal-test.tnsl index 73f5f77..6e55323 100644 --- a/tests/literal-test.tnsl +++ b/tests/literal-test.tnsl @@ -28,17 +28,19 @@ # Invalid (some may be weeded out through the verify phase): -;string s "" +#;string s "" -;int 0 i +#;int 0 i # Invalid ops should also be detected if dealing with literals -;char c ~= 's' +#;char c ~= 's' # Debate over weather these are legal -;int k = .1 +#;int k = .1 ;int l = 0x01 +;int i +;a a; diff --git a/tests/parameter-test.tnsl b/tests/parameter-test.tnsl index 96f6d41..cae89ab 100644 --- a/tests/parameter-test.tnsl +++ b/tests/parameter-test.tnsl @@ -14,5 +14,5 @@ limitations under the License. #/ ;int another = 0 -/; loop (int initial = 0, complex = 2) [initial < max || complex < 40, initial++, complex += 7, another += 2] +/; loop (int initial = 0, complex = 2) [initial < max || complex < 40; initial++; complex += 7; another += 2] ;/ diff --git a/tests/statement-test.tnsl b/tests/statement-test.tnsl index 71bd64b..b771e06 100644 --- a/tests/statement-test.tnsl +++ b/tests/statement-test.tnsl @@ -3,4 +3,4 @@ /; if_block ;; else_block -;/ \ No newline at end of file +;/ -- cgit v1.2.3