mirror of
https://github.com/macocianradu/RosettaHaskellCompiler.git
synced 2026-03-18 21:10:07 +00:00
rearranged some functions,
added check for multiple definitions changed naming of attributes in haskell
This commit is contained in:
@@ -6,6 +6,7 @@ import Semantic.ExpressionChecker
|
||||
import Semantic.TypeChecker
|
||||
import Data.Either
|
||||
import Data.Char
|
||||
import Utils.Utils
|
||||
|
||||
-- |Checks if all the inputs and the output of a function call have valid types, and then checks that the assign-output expression is valid
|
||||
checkFunction :: ([Type], [Symbol]) -> Function -> Either [TypeCheckError] Function
|
||||
@@ -16,7 +17,7 @@ checkFunction (definedTypes, symbols) (MakeFunction name desc inp out ex)
|
||||
Left err -> Left [err]
|
||||
| otherwise = Left $ lefts [checkedOut] ++ lefts checkedIn ++ lefts [checkedEx]
|
||||
where
|
||||
checkedIn = checkAttributes definedTypes inp
|
||||
localEnv = addVariables symbols inp
|
||||
checkedEx = checkExpression localEnv ex
|
||||
checkedIn = checkAttributes definedTypes inp
|
||||
checkedOut = head $ checkAttributes definedTypes [out]
|
||||
Reference in New Issue
Block a user