From c23b7cd159af38f588ce4214d6ad37ceadf3c1a6 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 27 Jul 2017 23:32:59 +0200 Subject: Centralise errors (needed for positional errors #5) --- Sil/Compile.dcl | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'Sil/Compile.dcl') diff --git a/Sil/Compile.dcl b/Sil/Compile.dcl index 7b0cf2f..61ee1b5 100644 --- a/Sil/Compile.dcl +++ b/Sil/Compile.dcl @@ -7,20 +7,7 @@ from Data.Error import :: MaybeError from ABC.Assembler import :: Assembler, :: Statement, instance <<< Assembler -from Sil.Syntax import :: Program, :: Name, :: Expression -from Sil.Types import :: Type, :: TypeError +from Sil.Error import :: Error +from Sil.Syntax import :: Program -:: CompileError - = UndefinedName Name - | UndefinedField Name - | VariableLabel - | FunctionOnStack - | TypeError TypeError Expression - | CouldNotDeduceType Expression - | TypeMisMatch Type Expression - | BasicInitWithoutValue Name - | UnknownError - -instance toString CompileError - -compile :: Program -> MaybeError CompileError Assembler +compile :: Program -> MaybeError Error Assembler -- cgit v1.2.3