This commit is contained in:
NikolajDanger
2022-06-09 11:10:09 +02:00
parent 305725a986
commit 41ed1788cb
2 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ let parse_error_rich =
// TODO: Add new (lexer) token definitions:
//
// TODO: project task 1 :
// - multiplication (*), division (/), numerical negation (~),
// - multiplication (*), division (/), numerical negation (~),
// logical negation (not), logical and (&&), logical or (||),
// boolean literals (true, false)
// - add the required precedence and associativity rules for

View File

@ -350,21 +350,21 @@ and checkExp (ftab : FunTable)
let elem_type =
match arr_type with
| Array t -> t
| _ -> reportTypeWrongKind "third argument of reduce" "array" arr_type pos
| _ -> reportTypeWrongKind "third argument of scan" "array" arr_type pos
let (f', f_argres_type) =
match checkFunArg ftab vtab pos f with
| (f', res, [a1; a2]) ->
if a1 <> a2 then
reportTypesDifferent "argument types of operation in reduce"
reportTypesDifferent "argument types of operation in scan"
a1 a2 pos
if res <> a1 then
reportTypesDifferent "argument and return type of operation in reduce"
reportTypesDifferent "argument and return type of operation in scan"
a1 res pos
(f', res)
| (_, res, args) ->
reportArityWrong "operation in reduce" 2 (args,res) pos
reportArityWrong "operation in scan" 2 (args,res) pos
if elem_type <> f_argres_type then
reportTypesDifferent "operation and array-element types in reduce"
reportTypesDifferent "operation and array-element types in scan"
f_argres_type elem_type pos
if e_type <> f_argres_type then
reportTypesDifferent "operation and start-element types in scan"