From 3395cd7dc356b61fe48ee9d755eef8a7b19ee9f1 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 29 Oct 2021 20:06:51 -0400 Subject: [AST] Statement parsing (incomplete) Still need to figure out a check for a type followed by a value --- tests/block-test.tnsl | 74 ++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 36 deletions(-) (limited to 'tests/block-test.tnsl') diff --git a/tests/block-test.tnsl b/tests/block-test.tnsl index 6dde05f..c48d7de 100644 --- a/tests/block-test.tnsl +++ b/tests/block-test.tnsl @@ -1,47 +1,49 @@ /# - Copyright 2020 Kyle Gunger + Copyright 2020 Kyle Gunger - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. #/ -/;if (i==0) - ;i = 2 -;/ -/: include - "this" - "that" -:/ +/; main + ;int i = 0 -# ;; can be used as a quick block re-definition + /;if (i==0) + ;i = 2 + ;/ -/;if (i==0) - ;i = 2 -;;else - ;i = 0 -;/ + /: include + "this" + "that" + :/ -# Comment block switching + # ;; can be used as a quick block re-definition -/; if (i == 2) - ;i = 4 -;# - Comment -#; else - ;i = 6 -;/ + /;if (i==0) + ;i = 2 + ;;else + ;i = 0 + ;/ -/; main + # Comment block switching + + /; if (i == 2) + ;i = 4 + ;# + Comment + #; else + ;i = 6 + ;/ ;/ /; module vec @@ -51,17 +53,17 @@ /;method Vector2 /; operator + (~Vector2 v) - ;self.x += `v.x - ;self.y += `v.y + ;self.x += v`.x + ;self.y += v`.y ;/ - /; operator + (int32 a) + /; operator + (int32 a) ;self.x += a ;self.y += a ;/ ;/ - ;struct FVector2 () {} + ;struct FVector2 () {} ;/ \ No newline at end of file -- cgit v1.2.3