diff options
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/convertcases.icl | 3 | ||||
-rw-r--r-- | frontend/parse.icl | 10 | ||||
-rw-r--r-- | frontend/postparse.icl | 4 | ||||
-rw-r--r-- | frontend/syntax.dcl | 4 | ||||
-rw-r--r-- | frontend/syntax.icl | 4 | ||||
-rw-r--r-- | frontend/trans.icl | 2 |
6 files changed, 16 insertions, 11 deletions
diff --git a/frontend/convertcases.icl b/frontend/convertcases.icl index 442deb7..e2a4ea8 100644 --- a/frontend/convertcases.icl +++ b/frontend/convertcases.icl @@ -280,7 +280,7 @@ newFunction opt_id fun_bodies local_vars arg_types result_type group_index (ci_n , fun_type = Yes fun_type , fun_pos = NoPos , fun_index = NoIndex - , fun_kind = FK_Function + , fun_kind = FK_Function cFunctionGenerated , fun_lifted = 0 , fun_info = { EmptyFunInfo & fi_group_index = group_index, fi_local_vars = local_vars } } @@ -834,6 +834,7 @@ where copy (DictionarySelection record selectors expr_ptr index_expr) cp_info # (index_expr, cp_info) = copy index_expr cp_info (selectors, cp_info) = copy selectors cp_info + (record, cp_info) = copy record cp_info = (DictionarySelection record selectors expr_ptr index_expr, cp_info) copy (ArraySelection selector expr_ptr index_expr) cp_info # (index_expr, cp_info) = copy index_expr cp_info diff --git a/frontend/parse.icl b/frontend/parse.icl index ef2cc50..b7ab535 100644 --- a/frontend/parse.icl +++ b/frontend/parse.icl @@ -470,17 +470,17 @@ where localsExpected = isNotEmpty args || isGlobalContext context (rhs, pState) = wantRhs isRhsStartToken localsExpected pState = case fun_kind of - FK_Function | isDclContext context + FK_Function _ | isDclContext context -> (PD_Function pos name is_infix args rhs fun_kind, parseError "RHS" No "<type specification>" pState) FK_Caf | isNotEmpty args -> (PD_Function pos name is_infix [] rhs fun_kind, parseError "CAF" No "No arguments for a CAF" pState) _ -> (PD_Function pos name is_infix args rhs fun_kind, pState) where - token_to_fun_kind s BarToken = (FK_Function, False, s) - token_to_fun_kind s (SeqLetToken _) = (FK_Function, False, s) - token_to_fun_kind s EqualToken = (FK_Function, True, s) + token_to_fun_kind s BarToken = (FK_Function cFunctionNotGenerated, False, s) + token_to_fun_kind s (SeqLetToken _) = (FK_Function cFunctionNotGenerated, False, s) + token_to_fun_kind s EqualToken = (FK_Function cFunctionNotGenerated, True, s) token_to_fun_kind s ColonDefinesToken = (FK_Macro, False, s) - token_to_fun_kind s DoubleArrowToken = (FK_Function, True, s) + token_to_fun_kind s DoubleArrowToken = (FK_Function cFunctionNotGenerated, True, s) token_to_fun_kind s DefinesColonToken = (FK_Caf, False, s) token_to_fun_kind s token = (FK_Unknown, False, parseError "RHS" (Yes token) "defines token (=, => or =:) or argument" s) diff --git a/frontend/postparse.icl b/frontend/postparse.icl index 107fb79..24bffa0 100644 --- a/frontend/postparse.icl +++ b/frontend/postparse.icl @@ -313,7 +313,7 @@ transformLambda lam_ident args result # lam_rhs = { rhs_alts = UnGuardedExpr { ewl_nodes = [], ewl_expr = result, ewl_locals = NoCollectedLocalDefs }, rhs_locals = NoCollectedLocalDefs } lam_body = [{pb_args = args, pb_rhs = lam_rhs }] - fun_def = MakeNewFunction lam_ident (length args) lam_body FK_Function NoPrio No NoPos + fun_def = MakeNewFunction lam_ident (length args) lam_body (FK_Function cFunctionGenerated) NoPrio No NoPos = fun_def makeNilExpression :: *CollectAdmin -> (ParsedExpr,*CollectAdmin) @@ -740,7 +740,7 @@ MakeNewFunction name arity body kind prio opt_type pos // +++ position MakeNewParsedDef ident args rhs - :== PD_Function NoPos ident False args rhs FK_Function + :== PD_Function NoPos ident False args rhs (FK_Function cFunctionGenerated) collectFunctionBodies :: !Ident !Int !Priority !FunKind ![ParsedDefinition] !*CollectAdmin -> (![ParsedBody], !FunKind, ![ParsedDefinition], !*CollectAdmin) diff --git a/frontend/syntax.dcl b/frontend/syntax.dcl index 5ee4821..e7d853c 100644 --- a/frontend/syntax.dcl +++ b/frontend/syntax.dcl @@ -134,7 +134,9 @@ cIsNotAFunction :== False | PD_ImportedObjects [ImportedObject] | PD_Erroneous -:: FunKind = FK_Function | FK_Macro | FK_Caf | FK_Unknown +:: FunKind = FK_Function !Bool | FK_Macro | FK_Caf | FK_Unknown +cFunctionNotGenerated :== False +cFunctionGenerated :== True :: ParsedSelector = { ps_field_name :: !Ident diff --git a/frontend/syntax.icl b/frontend/syntax.icl index aed17ec..d14a525 100644 --- a/frontend/syntax.icl +++ b/frontend/syntax.icl @@ -137,7 +137,9 @@ cIsNotAFunction :== False | PD_ImportedObjects [ImportedObject] | PD_Erroneous -:: FunKind = FK_Function | FK_Macro | FK_Caf | FK_Unknown +:: FunKind = FK_Function !Bool | FK_Macro | FK_Caf | FK_Unknown +cFunctionNotGenerated :== False +cFunctionGenerated :== True :: ParsedSelector = { ps_field_name :: !Ident diff --git a/frontend/trans.icl b/frontend/trans.icl index 502d69a..77aa76d 100644 --- a/frontend/trans.icl +++ b/frontend/trans.icl @@ -1021,7 +1021,7 @@ possibly_generate_case_function kees=:{case_info_ptr} aci=:{aci_free_vars} ro ti , fun_type = Yes fun_type , fun_pos = NoPos , fun_index = fun_index - , fun_kind = FK_Function + , fun_kind = FK_Function cFunctionGenerated , fun_lifted = undeff , fun_info = { fi_calls = [] , fi_group_index = outer_fun_def.fun_info.fi_group_index |