From 4ce6adb6f5dc6623b903853322be726a9f95a3b8 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 29 Nov 2023 11:26:28 +0100 Subject: Continue with cases WIP: todo is matching code for basic values and adding locals for constructor arguments in a pattern --- snug-clean/src/Snug/Compile.dcl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'snug-clean/src/Snug/Compile.dcl') diff --git a/snug-clean/src/Snug/Compile.dcl b/snug-clean/src/Snug/Compile.dcl index ef223b8..dd8bef1 100644 --- a/snug-clean/src/Snug/Compile.dcl +++ b/snug-clean/src/Snug/Compile.dcl @@ -29,13 +29,15 @@ from Snug.Syntax import :: ConstructorDef, :: ConstructorIdent, :: Definition, :: CompileState -:: Locals :== Map SymbolIdent LocalLocation +:: Locals :== Map SymbolIdent Symbol -:: Local = - { location :: !LocalLocation - , type :: !Type - } +:: Symbol + = LocalSymbol !LocalLocation + | FunctionSymbol !FunctionInfo + | ConstructorSymbol !ConstructorDef :: LocalLocation compile :: !Namespace ![Definition] -> MaybeError String [Line] + +lookupConstructorM :: !ConstructorIdent -> CompileM ConstructorDef -- cgit v1.2.3