aboutsummaryrefslogtreecommitdiff
path: root/Sil/Error.dcl
diff options
context:
space:
mode:
Diffstat (limited to 'Sil/Error.dcl')
-rw-r--r--Sil/Error.dcl35
1 files changed, 24 insertions, 11 deletions
diff --git a/Sil/Error.dcl b/Sil/Error.dcl
index 7df1976..14427c8 100644
--- a/Sil/Error.dcl
+++ b/Sil/Error.dcl
@@ -5,26 +5,39 @@ from StdOverloaded import class toString
from Sil.Syntax import :: Expression
from Sil.Types import :: Type
+from Sil.Util.Parser import :: Positioned
+
+:: ErrorPosition
:: Error
// Parser errors
- = E.a: P_Invalid String a & toString a
- | P_Expected String
+ = E.a: P_Invalid String a & toString a
+ | P_Expected String
// Type errors
- | T_IllegalApplication Type Type
- | T_IllegalField String Type
- | T_TooHighTupleArity Int
+ | T_IllegalApplication Type Type
+ | T_IllegalField String Type
+ | T_TooHighTupleArity Int
+ // Check errors
+ | Ck_NoMainFunction
+ | Ck_MainFunctionInvalidType ErrorPosition Type
+ | Ck_DuplicateFunctionName ErrorPosition String
+ | Ck_DuplicateLocalName ErrorPosition String String
+ | Ck_ReturnExpressionFromVoid ErrorPosition String
+ | Ck_NoReturnFromNonVoid ErrorPosition String
+ | Ck_LocalVoid String String
+ | Ck_BasicGlobal ErrorPosition String
// Compile errors
- | C_UndefinedName String
- | C_UndefinedField String
+ | C_UndefinedName String
+ | C_UndefinedField String
| C_VariableLabel
| C_FunctionOnStack
- | C_TypeError Error Expression
- | C_CouldNotDeduceType Expression
- | C_TypeMisMatch Type Expression Type
- | C_BasicInitWithoutValue String
+ | C_CouldNotDeduceType Expression
+ | C_TypeMisMatch Type Expression Type
+ | C_BasicInitWithoutValue String
// Miscellaneous
| UnknownError String
instance toString Error
instance <<< Error
+
+errpos :: (Positioned a) -> ErrorPosition