From e40b04daf942ae01125d43e5cd402a08735075fd Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Wed, 26 Jun 2024 15:27:24 +0200 Subject: Consolidate semantic analyzer functions --- tests/semantics.bad | 59 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'tests') diff --git a/tests/semantics.bad b/tests/semantics.bad index 6fa1c59..18ebec1 100644 --- a/tests/semantics.bad +++ b/tests/semantics.bad @@ -1,27 +1,44 @@ -struct vec { - x: f64 - y: f64 - huh: { - z: int - id: str - } +fun foo(): int { + 1 } +; fun bar(): int { +; fun foo(): int 1 + 2 +; 1 +; } +; struct vec { +; x: f64 +; y: f64 +; huh: { +; z: int +; id: str +; } +; } +; let a = 1 +; let a = 2 +; struct vec { +; x: f64 +; y: f64 +; huh: { +; z: int +; id: str +; } +; } -let v: vec = vec : { - x = 10.0 - huh = { - z = 10 - id = "blah" - } -} +; let v: vec = vec : { +; x = 10.0 +; huh = { +; z = 10 +; id = "blah" +; } +; } -fun foo(): nil { - struct vec { - z: f64 - } - let a: vec - set a.z = 1.0 -} +; fun foo(): nil { +; struct vec { +; z: f64 +; } +; let a: vec +; set a.z = 1.0 +; } ; struct vec { ; x: f64 = 2.0 -- cgit v1.2.1