diff options
author | johnvg | 2003-01-06 12:46:15 +0000 |
---|---|---|
committer | johnvg | 2003-01-06 12:46:15 +0000 |
commit | 2690ba865f8203891282a105118aeb478d7d4ac8 (patch) | |
tree | c5f65c740a8b7d14dc956f10e5611b066e36d8c6 /frontend/postparse.icl | |
parent | bug fix: check explicit import completeness for TAS constructor (diff) |
report "macro with function type not allowed" error for
macros with a function type, instead of ignoring the
type, or crashing when the arity is incorrect
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1303 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/postparse.icl')
-rw-r--r-- | frontend/postparse.icl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/frontend/postparse.icl b/frontend/postparse.icl index 7db57bd..a81a358 100644 --- a/frontend/postparse.icl +++ b/frontend/postparse.icl @@ -1280,8 +1280,10 @@ reorganiseDefinitions icl_module [PD_TypeSpec pos name prio (Yes fun_type=:{st_a = (fun_defs, c_defs, imports, imported_objects, ca) # fun = MakeNewImpOrDefFunction name fun_type.st_arity bodies fun_kind prio (Yes fun_type) pos | icl_module - = ([fun : fun_defs], c_defs, imports, imported_objects, ca) - = ([fun : fun_defs], c_defs, imports, imported_objects, postParseError pos "function body not allowed in definition module" ca) + | case fun_kind of FK_Macro -> True; _ -> False + = ([fun : fun_defs], c_defs, imports, imported_objects, postParseError pos "macro with function type not allowed" ca) + = ([fun : fun_defs], c_defs, imports, imported_objects, ca) + = ([fun : fun_defs], c_defs, imports, imported_objects, postParseError pos "function body not allowed in definition module" ca) reorganiseDefinitions icl_module [PD_Type type_def=:{td_rhs = ConsList cons_defs} : defs] cons_count sel_count mem_count type_count ca # (cons_symbs, cons_count) = determine_symbols_of_conses cons_defs cons_count (fun_defs, c_defs, imports, imported_objects, ca) = reorganiseDefinitions icl_module defs cons_count sel_count mem_count (type_count+1) ca |