diff options
author | Camil Staps | 2017-08-18 21:15:40 +0200 |
---|---|---|
committer | Camil Staps | 2017-08-18 21:15:40 +0200 |
commit | 6e8c5385fc3dc9416f59fa48657685506d3045eb (patch) | |
tree | 92ca243d5f365578de6986692a99043d52549383 /Sil/Error.icl | |
parent | Made some more errors positional (#5) (diff) |
Positional errors fully implemented; resolves #5
Diffstat (limited to 'Sil/Error.icl')
-rw-r--r-- | Sil/Error.icl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Sil/Error.icl b/Sil/Error.icl index e548e33..66fb338 100644 --- a/Sil/Error.icl +++ b/Sil/Error.icl @@ -26,7 +26,7 @@ instance toString Error where toString (P_Invalid w tk) = "\tInvalid token '" <+ tk <+ "' while parsing a " <+ w <+ "." toString (P_Expected p s h) = p <+ "Expected " <+ s <+ " near '" <+ h <+ "'." - toString (T_IllegalApplication ft et) = "\tCannot apply a " <+ et <+ " to a " <+ ft <+ "." + toString (T_IllegalApplication p ft et) = p <+ "Cannot apply a " <+ et <+ " to a " <+ ft <+ "." toString (T_IllegalField p f t) = p <+ "Illegal field '" <+ f <+ "' on type " <+ t <+ "." toString (T_TooHighTupleArity p i) = p <+ "Too high tuple arity " <+ i <+ " (maximum is 32)." toString Ck_NoMainFunction = "\tError: no main function." @@ -39,8 +39,6 @@ where toString (Ck_BasicGlobal p g) = p <+ "Error: global variable '" <+ g <+ "' cannot have a basic type." toString (C_UndefinedName p n) = p <+ "Undefined name '" <+ n <+ "'." toString (C_UndefinedField p f) = p <+ "Undefined field '" <+ f <+ "'." - toString C_VariableLabel = "\tVariable stored at label." - toString C_FunctionOnStack = "\tFunction stored on the stack." toString (C_CouldNotDeduceType e) = errpos e <+ "Could not deduce type of '" <+ e <+ "'." toString (C_TypeMisMatch t e u) = errpos e <+ "Type mismatch: expected " <+ t <+ " for '" <+ e <+ "'; had " <+ u <+ "." toString (C_BasicInitWithoutValue p n) = p <+ "Basic value '" <+ n <+ "' must have an initial value." @@ -60,7 +58,7 @@ where getErrorPosition :: Error -> Maybe ErrorPosition getErrorPosition (P_Invalid w tk) = Nothing getErrorPosition (P_Expected p s h) = Just p -getErrorPosition (T_IllegalApplication ft et) = Nothing +getErrorPosition (T_IllegalApplication p ft et) = Just p getErrorPosition (T_IllegalField p f t) = Just p getErrorPosition (T_TooHighTupleArity p i) = Just p getErrorPosition Ck_NoMainFunction = Nothing @@ -73,8 +71,6 @@ getErrorPosition (Ck_LocalVoid p l) = Just p getErrorPosition (Ck_BasicGlobal p g) = Just p getErrorPosition (C_UndefinedName p n) = Just p getErrorPosition (C_UndefinedField p f) = Just p -getErrorPosition C_VariableLabel = Nothing -getErrorPosition C_FunctionOnStack = Nothing getErrorPosition (C_CouldNotDeduceType e) = Just (errpos e) getErrorPosition (C_TypeMisMatch t e u) = Just (errpos e) getErrorPosition (C_BasicInitWithoutValue p n) = Just p |