✨
This commit is contained in:
@@ -23,7 +23,7 @@ let parse_error_rich =
|
|||||||
// TODO: Add new (lexer) token definitions:
|
// TODO: Add new (lexer) token definitions:
|
||||||
//
|
//
|
||||||
// TODO: project task 1 :
|
// TODO: project task 1 :
|
||||||
// - multiplication (*), division (/), numerical negation (~),
|
// - multiplication (*), division (/), numerical negation (~),
|
||||||
// logical negation (not), logical and (&&), logical or (||),
|
// logical negation (not), logical and (&&), logical or (||),
|
||||||
// boolean literals (true, false)
|
// boolean literals (true, false)
|
||||||
// - add the required precedence and associativity rules for
|
// - add the required precedence and associativity rules for
|
||||||
|
|||||||
@@ -350,21 +350,21 @@ and checkExp (ftab : FunTable)
|
|||||||
let elem_type =
|
let elem_type =
|
||||||
match arr_type with
|
match arr_type with
|
||||||
| Array t -> t
|
| 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) =
|
let (f', f_argres_type) =
|
||||||
match checkFunArg ftab vtab pos f with
|
match checkFunArg ftab vtab pos f with
|
||||||
| (f', res, [a1; a2]) ->
|
| (f', res, [a1; a2]) ->
|
||||||
if a1 <> a2 then
|
if a1 <> a2 then
|
||||||
reportTypesDifferent "argument types of operation in reduce"
|
reportTypesDifferent "argument types of operation in scan"
|
||||||
a1 a2 pos
|
a1 a2 pos
|
||||||
if res <> a1 then
|
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
|
a1 res pos
|
||||||
(f', res)
|
(f', res)
|
||||||
| (_, res, args) ->
|
| (_, 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
|
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
|
f_argres_type elem_type pos
|
||||||
if e_type <> f_argres_type then
|
if e_type <> f_argres_type then
|
||||||
reportTypesDifferent "operation and start-element types in scan"
|
reportTypesDifferent "operation and start-element types in scan"
|
||||||
|
|||||||
Reference in New Issue
Block a user