From 130b77ede3cce7d9b623174977429f2240e9fc11 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 27 Sep 2023 20:28:57 +0100 Subject: Define declared variables for structs --- .../java/org/shedlang/compiler/typechecker/DeclaredVariables.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/org/shedlang/compiler/typechecker/DeclaredVariables.java b/src/main/java/org/shedlang/compiler/typechecker/DeclaredVariables.java index b12061f8..a6cfde24 100644 --- a/src/main/java/org/shedlang/compiler/typechecker/DeclaredVariables.java +++ b/src/main/java/org/shedlang/compiler/typechecker/DeclaredVariables.java @@ -73,7 +73,11 @@ class DeclaredVariables { )); case UntypedStructDefinitionNode struct -> - throw new UnsupportedOperationException("TODO"); + variables.plus(new DeclaredVariable( + struct.name(), + VariableType.CONSTANT, + struct.source() + )); }; } -- cgit v1.2.3