Commit 576d5e59 authored by John van Groningen's avatar John van Groningen
Browse files

add explicit import of generic functions

parent 128c01a0
......@@ -1859,15 +1859,19 @@ checkDclModules imports_of_icl_mod dcl_modules icl_functions macro_defs heaps cs
ei_symbols=expl_imp_indices, ei_qualified=import_qualified}
= (expl_imp_symbols_accu, nr_of_expl_imp_symbols, [explicit_import:expl_imp_indices_accu], cs_symbol_table)
get_expl_imp_symbol imp_decl state
= get_symbol imp_decl (get_ident imp_decl) state
where
get_ident :: !ImportDeclaration -> Ident
get_ident (ID_Function ii_ident) = ii_ident
get_ident (ID_Class ii_ident _) = ii_ident
get_ident (ID_Type ii_ident _) = ii_ident
get_ident (ID_Record ii_ident _) = ii_ident
get_ident (ID_Instance class_ident instance_ident _) = instance_ident
get_expl_imp_symbol imp_decl=:(ID_Function ident) state
= get_symbol imp_decl ident state
get_expl_imp_symbol imp_decl=:(ID_Class ident _) state
= get_symbol imp_decl ident state
get_expl_imp_symbol imp_decl=:(ID_Type ident _) state
= get_symbol imp_decl ident state
get_expl_imp_symbol imp_decl=:(ID_Record ident _) state
= get_symbol imp_decl ident state
get_expl_imp_symbol imp_decl=:(ID_Instance class_ident instance_ident _) state
= get_symbol imp_decl instance_ident state
get_expl_imp_symbol (ID_Generic generic_ident ident) state
= get_symbol (ID_Function ident) ident
(get_symbol (ID_Function generic_ident) generic_ident state)
get_symbol :: ImportDeclaration !Ident !*([Ident],Int,[ImportNrAndIdents],*(Heap SymbolTableEntry)) -> ([Ident],Int,[ImportNrAndIdents],.(Heap SymbolTableEntry))
get_symbol imp_decl ident=:{id_info} (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices_accu, cs_symbol_table)
......
......@@ -1174,6 +1174,11 @@ wantImportDeclarationT token pState
# (fun_id, pState) = stringToIdent fun_name IC_Expression pState
(ii_extended, pState) = optional_extension pState
-> (ID_Function fun_id, pState)
GenericToken
# (name, pState) = want pState
(generic_id, pState) = stringToIdent name IC_Generic pState
(expr_id, pState) = stringToIdent name IC_Expression pState
-> (ID_Generic generic_id expr_id, pState)
token
# (fun_id, pState) = stringToIdent "dummy" IC_Expression pState
-> ( ID_Function fun_id
......
......@@ -373,8 +373,8 @@ cNameLocationDependent :== True
}
:: GenericDef =
{ gen_ident :: !Ident // the generics name in IC_Class
, gen_member_ident :: !Ident // the generics name in IC_Member
{ gen_ident :: !Ident // the generics name in IC_Generic
, gen_member_ident :: !Ident // the generics name in IC_Expression
, gen_pos :: !Position
, gen_type :: !SymbolType // Generic type (st_vars include generic type vars)
, gen_vars :: ![TypeVar] // Generic type variables
......@@ -460,6 +460,7 @@ instance toString (Import from_symbol), AttributeVar, TypeAttribute, Annotation
| ID_Type !Ident !(Optional [Ident])
| ID_Record !Ident !(Optional [Ident])
| ID_Instance !Ident !Ident !(![Type],![TypeContext])
| ID_Generic !Ident !Ident
cIsImportedLibrary :== True
cIsImportedObject :== False
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment