blob: bdfa39043dc77017746fd55ae50e8c6c534846b4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
definition module Sil.Error
from StdFile import class <<<
from StdOverloaded import class toString, class <
from Data.Maybe import :: Maybe
from Sil.Syntax import :: Expression
from Sil.Types import :: Type
from Sil.Util.Parser import :: ParsePosition, class getPos
:: ErrorPosition
instance < ErrorPosition
:: Error
// Parser errors
= E.a: P_Invalid String a & toString a
| E.a: P_Expected ErrorPosition String a & toString a
// Type errors
| 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_VariableLabel
| C_FunctionOnStack
| C_CouldNotDeduceType Expression
| C_TypeMisMatch Type Expression Type
| C_BasicInitWithoutValue String
// Miscellaneous
| UnknownError String
instance toString Error
instance <<< Error
instance < Error // Based on position in file, to choose the furthest error in the parser
getErrorPosition :: Error -> Maybe ErrorPosition
errpos :: a -> ErrorPosition | getPos a
|