diff options
author | ronny | 2001-12-12 15:51:59 +0000 |
---|---|---|
committer | ronny | 2001-12-12 15:51:59 +0000 |
commit | fdf4a8caf999c3d64c56bb2d3457718f496bf1a7 (patch) | |
tree | 22b27005bf1aa1d78a65fa4b5088489fa654c2a6 /frontend/postparse.icl | |
parent | enforce consistency of defining symbols in rhs (diff) |
don't allow local nodedefs (defined with =:) with a specified type
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@927 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/postparse.icl')
-rw-r--r-- | frontend/postparse.icl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/frontend/postparse.icl b/frontend/postparse.icl index a66dd1c..99ac98e 100644 --- a/frontend/postparse.icl +++ b/frontend/postparse.icl @@ -25,15 +25,17 @@ optGuardedAltToRhs optGuardedAlt } exprToRhs expr - :== { rhs_alts = UnGuardedExpr - { ewl_nodes = [] - , ewl_expr = expr - , ewl_locals = LocalParsedDefs [] - , ewl_position= NoPos - } + :== { rhs_alts = UnGuardedExpr (exprToExprWithLocalDefs expr) , rhs_locals = LocalParsedDefs [] } +exprToExprWithLocalDefs expr + :== { ewl_nodes = [] + , ewl_expr = expr + , ewl_locals = LocalParsedDefs [] + , ewl_position= NoPos + } + prefixAndPositionToIdent :: !String !LineAndColumn !*CollectAdmin -> (!Ident, !*CollectAdmin) prefixAndPositionToIdent prefix {lc_line, lc_column} ca=:{ca_hash_table} # ({boxed_ident=ident}, ca_hash_table) = putIdentInHashTable (prefix +++ ";" +++ toString lc_line +++ ";" +++ toString lc_column) IC_Expression ca_hash_table @@ -278,6 +280,11 @@ where reorganiseLocalDefinitions [PD_NodeDef pos pattern {rhs_alts,rhs_locals} : defs] ca # (fun_defs, node_defs, ca) = reorganiseLocalDefinitions defs ca = (fun_defs, [{ nd_dst = pattern, nd_alts = rhs_alts, nd_locals = rhs_locals, nd_position = pos } : node_defs], ca) + + reorganiseLocalDefinitions [PD_Function pos name is_infix [] {rhs_alts, rhs_locals} FK_NodeDefOrFunction : defs] ca + # (fun_defs, node_defs, ca) = reorganiseLocalDefinitions defs ca + = (fun_defs, [{ nd_dst = PE_Ident name, nd_alts = rhs_alts, nd_locals = rhs_locals, nd_position = pos } : node_defs], ca) + reorganiseLocalDefinitions [PD_Function pos name is_infix args rhs fun_kind : defs] ca # prio = if is_infix (Prio NoAssoc 9) NoPrio fun_arity = length args |