sutori-0.2.4: Sutori language compiler

Safe HaskellSafe
LanguageHaskell2010

Sutori.Error

Description

 

Synopsis

Documentation

data SutError Source #

Different possible Sutori Errors

Constructors

LexicalError

An unknown or malformed token was read

GrammaticalError

The source code does not follow Sutori grammar

TypeError

A Type error occurred

UndefinedSymbolError

A symbol was used before it was defined

ArgumentsNumberError

A function was called with the wrong number of arguments

DuplicateSymbolError

A symbol was defined twice in the same scope

InternalError

The compiler failed for a known reason (not the user's fault)

NoError

The lack of error

logError :: SutLogger -> [(SutError, SutLog)] Source #

The `error' log

lexerError :: String -> SutMonad () Source #

Logs a lexical error and continues

parserError :: SutToken -> SutMonad a Source #

Logs a parsing error and throws out

typeError :: SutExpression -> SutType -> SutType -> String -> SutMonad () Source #

Logs a type error and continues

undefinedError :: SutID -> SymbolCat -> String -> SutMonad () Source #

Logs an undefined symbol error and continues

duplicateSymbolError :: SutSymbol a => a -> SutMonad () Source #

Logs a duplicate symbol error and continues

duplicateMemberError :: SutID -> SutMonad () Source #

Logs a duplicate member error and continues

argumentsNumberError :: SutID -> Int -> Int -> SutMonad () Source #

Logs a wrong number of parameters error and continues