Commit 0d639d67 authored by John van Groningen's avatar John van Groningen
Browse files

replace fields icl_import and icl_qualified_imports by icl_imported_instances,

add type GlobalInstanceIndex,
add function collect_imported_instances to module explicitimports,
remove unused Position from si_qualified_explicit
parent df67bef9
......@@ -1623,7 +1623,6 @@ checkDclModules imports_of_icl_mod dcl_modules macro_defs heaps cs=:{cs_symbol_t
components_array = {! component \\ component <- components }
(expl_imp_symbols_in_components, expl_imp_indices, (dcl_modules, cs_symbol_table))
= mapY2St (get_expl_imp_symbols_of_component imports_of_icl_mod) components (dcl_modules, cs_symbol_table)
expl_imp_infos
= {idents_to_empty_ExplImpInfo_array expl_imp_symbols_in_component \\ expl_imp_symbols_in_component<-expl_imp_symbols_in_components}
// eii_declaring_modules will be updated later
......@@ -1674,7 +1673,7 @@ checkDclModules imports_of_icl_mod dcl_modules macro_defs heaps cs=:{cs_symbol_t
# (mod_imports, dcl_modules, cs_symbol_table)
= get_mod_imports (mod_index==siz) imports_of_icl_mod dcl_modules cs_symbol_table
(expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices, cs_symbol_table)
= foldSt get_expl_imp_symbols mod_imports (expl_imp_symbols_accu, nr_of_expl_imp_symbols, [], cs_symbol_table)
= foldSt get_expl_imp_symbols_of_import mod_imports (expl_imp_symbols_accu, nr_of_expl_imp_symbols, [], cs_symbol_table)
= (expl_imp_symbols_accu, nr_of_expl_imp_symbols, [expl_imp_indices:expl_imp_indices_accu],dcl_modules, cs_symbol_table)
where
get_mod_imports is_icl_mod=:False _ dcl_modules cs_symbol_table
......@@ -1688,13 +1687,13 @@ checkDclModules imports_of_icl_mod dcl_modules macro_defs heaps cs=:{cs_symbol_t
get_mod_imports _ imports_of_icl_mod dcl_modules cs_symbol_table
= (imports_of_icl_mod, dcl_modules, cs_symbol_table)
get_expl_imp_symbols :: ParsedImport *([Ident],Int,[ExplicitImport],*SymbolTable) -> ([Ident],Int,[ExplicitImport],*SymbolTable)
get_expl_imp_symbols {import_module,import_symbols,import_file_position,import_qualified} (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices_accu, cs_symbol_table)
get_expl_imp_symbols_of_import :: ParsedImport *([Ident],Int,[ExplicitImport],*SymbolTable) -> ([Ident],Int,[ExplicitImport],*SymbolTable)
get_expl_imp_symbols_of_import {import_module,import_symbols,import_file_position,import_qualified} (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices_accu, cs_symbol_table)
# (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices, cs_symbol_table)
= case import_symbols of
ImportSymbolsOnly import_symbols
# (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices, cs_symbol_table)
= foldSt get_expl_imp_symbol import_symbols (expl_imp_symbols_accu, nr_of_expl_imp_symbols, [], cs_symbol_table)
= get_expl_imp_symbols import_symbols (expl_imp_symbols_accu, nr_of_expl_imp_symbols, [], cs_symbol_table)
-> (expl_imp_symbols_accu, nr_of_expl_imp_symbols, ImportSymbolsOnly expl_imp_indices, cs_symbol_table)
ImportSymbolsAll
-> (expl_imp_symbols_accu, nr_of_expl_imp_symbols, ImportSymbolsAll, cs_symbol_table)
......@@ -1703,21 +1702,24 @@ checkDclModules imports_of_icl_mod dcl_modules macro_defs heaps cs=:{cs_symbol_t
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=:(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_expl_imp_symbols import_symbols state
= foldSt get_expl_imp_symbol import_symbols state
where
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],*SymbolTable) -> ([Ident],Int,[ImportNrAndIdents],*SymbolTable)
get_symbol imp_decl ident=:{id_info} (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices_accu, cs_symbol_table)
# (ste, cs_symbol_table) = readPtr id_info cs_symbol_table
= case ste.ste_kind of
......@@ -2423,13 +2425,13 @@ check_module2 mod_ident mod_modification_time mod_imported_objects mod_imports m
(dcls_import_list, dcl_modules, cs)
= addImportedSymbolsToSymbolTable nr_of_modules (Yes dcl_macros) modules_in_component_set imports_ikh dcl_modules cs
qualified_explicit_imports = (ikhSearch` nr_of_modules imports_ikh).si_qualified_explicit
{si_qualified_explicit} = ikhSearch` nr_of_modules imports_ikh
(dcl_modules, macro_defs,hp_expression_heap, cs)
= checkExplicitImportCompleteness imports.si_explicit qualified_explicit_imports dcl_modules macro_defs heaps.hp_expression_heap cs
= checkExplicitImportCompleteness imports.si_explicit si_qualified_explicit dcl_modules macro_defs heaps.hp_expression_heap cs
heaps = { heaps & hp_expression_heap=hp_expression_heap }
(modified_ste_kinds,symbol_table,dcl_modules)
= store_qualified_explicit_imports_in_symbol_table qualified_explicit_imports [] cs.cs_symbol_table dcl_modules
= store_qualified_explicit_imports_in_symbol_table si_qualified_explicit [] cs.cs_symbol_table dcl_modules
#! first_inst_index = size icl_functions
first_gen_inst_index = first_inst_index + length inst_fun_defs
......@@ -2540,6 +2542,8 @@ check_module2 mod_ident mod_modification_time mod_imported_objects mod_imports m
cs_symbol_table = foldlArraySt removeImportedSymbolsFromSymbolTable icl_imported cs_symbol_table
dcl_modules = e_info.ef_modules
icl_imported_instances = collect_imported_instances icl_imported si_qualified_explicit
| cs_error.ea_ok
# {hp_var_heap,hp_type_heaps=hp_type_heaps=:{th_vars},hp_expression_heap} = heaps
......@@ -2564,7 +2568,7 @@ check_module2 mod_ident mod_modification_time mod_imported_objects mod_imports m
ifi_gencase_indices = icl_generic_ranges, ifi_type_function_indices = icl_type_fun_ranges }
icl_mod = { icl_name = mod_ident, icl_functions = icl_functions, icl_function_indices = icl_function_indices,
icl_common = icl_common, icl_import = icl_imported, icl_qualified_imports = qualified_explicit_imports,
icl_common = icl_common, icl_imported_instances = icl_imported_instances,
icl_imported_objects = mod_imported_objects, icl_foreign_exports = foreign_exports,
icl_used_module_numbers = imported_module_numbers, icl_modification_time = mod_modification_time }
......@@ -2594,7 +2598,7 @@ check_module2 mod_ident mod_modification_time mod_imported_objects mod_imports m
ifi_gencase_indices = icl_generic_ranges, ifi_type_function_indices = icl_type_fun_ranges }
icl_mod = { icl_name = mod_ident, icl_functions = icl_functions, icl_function_indices = icl_function_indices,
icl_common = icl_common, icl_import = icl_imported, icl_qualified_imports = qualified_explicit_imports,
icl_common = icl_common, icl_imported_instances = icl_imported_instances,
icl_imported_objects = mod_imported_objects, icl_foreign_exports = foreign_exports,
icl_used_module_numbers = imported_module_numbers, icl_modification_time = mod_modification_time }
= (False, icl_mod, dcl_modules, {}, {}, cs_x.x_main_dcl_module_n,heaps, cs_predef_symbols, cs_symbol_table, cs_error.ea_file, directly_imported_dcl_modules)
......@@ -2991,9 +2995,8 @@ addImportedSymbolsToSymbolTable importing_mod opt_macro_range modules_in_compone
# {si_explicit, si_implicit} = ikhSearch` mod_index imports_ikh
(decls_accu,dcl_modules,cs)
= foldSt (\(decls, _) state ->
foldSt (\decl state -> add_declaration opt_macro_range importing_mod decl state)
decls state)
si_explicit (decls_accu,dcl_modules,cs)
foldSt (add_declaration opt_macro_range importing_mod) decls state
) si_explicit (decls_accu,dcl_modules,cs)
= foldSt (\(mod_index, _) state
-> add_impl_imported_symbols opt_macro_range importing_mod modules_in_component_set
imports_ikh mod_index state)
......
......@@ -20,7 +20,7 @@ import syntax, checksupport
:: SolvedImports =
{ si_explicit :: ![([Declaration], Position)]
, si_qualified_explicit :: ![([Declaration], ModuleN, Position)]
, si_qualified_explicit :: ![([Declaration], ModuleN)]
, si_implicit :: ![(ModuleN, Position)]
}
......@@ -37,11 +37,11 @@ solveExplicitImports :: !(IntKeyHashtable [ExplicitImport]) !{#Int} !Index
!*(!v:{#DclModule},!*{#Int},!{!*ExplImpInfo},!*CheckState)
-> (!.SolvedImports,! (!v:{#DclModule},!.{#Int},!{!.ExplImpInfo},!.CheckState))
checkExplicitImportCompleteness :: ![([Declaration], Position)] ![([Declaration], Int, Position)]
checkExplicitImportCompleteness :: ![([Declaration], Position)] ![([Declaration], Int)]
!*{#DclModule} !*{#*{#FunDef}} !*ExpressionHeap !*CheckState
-> (!.{#DclModule},!*{#*{#FunDef}},!.ExpressionHeap,!.CheckState)
store_qualified_explicit_imports_in_symbol_table :: ![([Declaration],Int,Position)] ![(SymbolPtr,STE_Kind)] !*SymbolTable !*{#DclModule} -> (![(SymbolPtr,STE_Kind)],!*SymbolTable,!*{#DclModule})
store_qualified_explicit_imports_in_symbol_table :: ![([Declaration],Int)] ![(SymbolPtr,STE_Kind)] !*SymbolTable !*{#DclModule} -> (![(SymbolPtr,STE_Kind)],!*SymbolTable,!*{#DclModule})
:: NameSpaceN:==Int
......@@ -59,3 +59,5 @@ search_qualified_imports :: !String !SortedQualifiedImports !NameSpaceN -> [Decl
qualified_import_for_type :: !String !SortedQualifiedImports -> Bool
restore_module_ste_kinds_in_symbol_table :: ![(SymbolPtr,STE_Kind)] !*SymbolTable -> *SymbolTable
collect_imported_instances :: !{!Declaration} ![([Declaration],ModuleN)] -> [!GlobalInstanceIndex!]
......@@ -26,7 +26,7 @@ implies a b :== not a || b
:: SolvedImports =
{ si_explicit :: ![([Declaration], Position)]
, si_qualified_explicit :: ![([Declaration], ModuleN, Position)]
, si_qualified_explicit :: ![([Declaration], ModuleN)]
, si_implicit :: ![(ModuleN, Position)]
}
......@@ -179,7 +179,7 @@ solveExplicitImports expl_imp_indices_ikh modules_in_component_set importing_mod
(decl_accu, dcl_modules, visited_modules, expl_imp_info, cs)
= solve_belongings unsolved_belonging position expl_imp_indices_ikh modules_in_component_set path
(decl_accu, dcl_modules, visited_modules, expl_imp_info, { cs & cs_error = cs_error })
= ((decl_accu, imported_mod, position), (dcl_modules, visited_modules, expl_imp_info, cs))
= ((decl_accu, imported_mod), (dcl_modules, visited_modules, expl_imp_info, cs))
search_expl_imp_symbols imported_symbols expl_imp_indices_ikh modules_in_component_set path imported_mod state
= foldSt (search_expl_imp_symbol expl_imp_indices_ikh modules_in_component_set path imported_mod)
......@@ -478,7 +478,7 @@ get_eei_ident (eii=:ExplImpInfo eii_ident _) = (eii_ident, eii)
:: CheckCompletenessInputBox = { box_cci :: !CheckCompletenessInput }
checkExplicitImportCompleteness :: ![([Declaration], Position)] ![([Declaration], Int, Position)]
checkExplicitImportCompleteness :: ![([Declaration], Position)] ![([Declaration], Int)]
!*{#DclModule} !*{#*{#FunDef}} !*ExpressionHeap !*CheckState
-> (!.{#DclModule},!*{#*{#FunDef}},!.ExpressionHeap,!.CheckState)
checkExplicitImportCompleteness dcls_explicit explicit_qualified_imports dcl_modules macro_defs expr_heap cs=:{cs_symbol_table, cs_error}
......@@ -896,8 +896,8 @@ stupid_ident =: { id_name = "stupid", id_info = nilPtr }
// XXX from m import :: T(..) works also if T is a record type
store_qualified_explicitly_imported_symbols_in_symbol_table :: ![([Declaration],Int,Position)] ![SymbolPtr] !*SymbolTable -> (![SymbolPtr],!*SymbolTable)
store_qualified_explicitly_imported_symbols_in_symbol_table [(declarations,module_n,position):qualified_explicit_imports] modified_symbol_ptrs symbol_table
store_qualified_explicitly_imported_symbols_in_symbol_table :: ![([Declaration],Int)] ![SymbolPtr] !*SymbolTable -> (![SymbolPtr],!*SymbolTable)
store_qualified_explicitly_imported_symbols_in_symbol_table [(declarations,module_n):qualified_explicit_imports] modified_symbol_ptrs symbol_table
# (modified_symbol_ptrs,symbol_table) = foldSt store_qualified_explicitly_imported_symbol declarations (modified_symbol_ptrs,symbol_table)
= store_qualified_explicitly_imported_symbols_in_symbol_table qualified_explicit_imports modified_symbol_ptrs symbol_table
where
......@@ -929,8 +929,8 @@ restore_symbol_table_after_checking_completeness modified_symbol_ptrs symbol_tab
= ste_kind
= writePtr symbol_ptr {symbol_ste & ste_kind=ste_kind} symbol_table
store_qualified_explicit_imports_in_symbol_table :: ![([Declaration],Int,Position)] ![(SymbolPtr,STE_Kind)] !*SymbolTable !*{#DclModule} -> (![(SymbolPtr,STE_Kind)],!*SymbolTable,!*{#DclModule})
store_qualified_explicit_imports_in_symbol_table [(declarations,module_n,position):qualified_explicit_imports] modified_ste_kinds symbol_table modules
store_qualified_explicit_imports_in_symbol_table :: ![([Declaration],Int)] ![(SymbolPtr,STE_Kind)] !*SymbolTable !*{#DclModule} -> (![(SymbolPtr,STE_Kind)],!*SymbolTable,!*{#DclModule})
store_qualified_explicit_imports_in_symbol_table [(declarations,module_n):qualified_explicit_imports] modified_ste_kinds symbol_table modules
# (module_symbol_ptr,modules) = modules![module_n].dcl_name.id_info
(module_ste=:{ste_kind},symbol_table) = readPtr module_symbol_ptr symbol_table
(modified_ste_kinds,sorted_qualified_imports)
......@@ -1063,3 +1063,32 @@ restore_module_ste_kinds_in_symbol_table [(ptr,ste_kind):ptrs_and_ste_kinds] sym
= restore_module_ste_kinds_in_symbol_table ptrs_and_ste_kinds symbol_table
restore_module_ste_kinds_in_symbol_table [] symbol_table
= symbol_table
collect_imported_instances :: !{!Declaration} ![([Declaration],ModuleN)] -> [!GlobalInstanceIndex!]
collect_imported_instances icl_imports icl_qualified_imports
# instance_indices = collect_imported_instances_in_array 0 icl_imports
= collect_qualified_imported_instances icl_qualified_imports instance_indices
where
collect_imported_instances_in_array :: !Int !{!Declaration} -> [!GlobalInstanceIndex!]
collect_imported_instances_in_array i imports
| i<size imports
= case imports.[i] of
Declaration {decl_kind = STE_Imported STE_Instance mod_index, decl_index}
-> [! {gii_module_n=mod_index,gii_instance_n=decl_index} : collect_imported_instances_in_array (i+1) imports !]
_
-> collect_imported_instances_in_array (i+1) imports
= [!!]
collect_qualified_imported_instances :: ![([Declaration],a)] ![!GlobalInstanceIndex!] -> [!GlobalInstanceIndex!]
collect_qualified_imported_instances [(declarations,_):qualified_imports] instance_indices
= collect_imported_instances_in_list declarations (collect_qualified_imported_instances qualified_imports instance_indices)
collect_qualified_imported_instances [] instance_indices
= instance_indices
collect_imported_instances_in_list :: ![Declaration] ![!GlobalInstanceIndex!] -> [!GlobalInstanceIndex!]
collect_imported_instances_in_list [Declaration {decl_kind = STE_Imported STE_Instance mod_index, decl_index}:declarations] instance_indices
= [! {gii_module_n=mod_index,gii_instance_n=decl_index} : collect_imported_instances_in_list declarations instance_indices!]
collect_imported_instances_in_list [_:declarations] instance_indices
= collect_imported_instances_in_list declarations instance_indices
collect_imported_instances_in_list [] instance_indices
= instance_indices
......@@ -39,7 +39,7 @@ instance == FunctionOrMacroIndex
| STE_Type
| STE_Constructor
| STE_Selector ![Global Index]
| STE_Field !Ident
| STE_Field !Ident // IC_Selector
| STE_Class
| STE_Member
| STE_Generic
......@@ -139,8 +139,7 @@ instance == FunctionOrMacroIndex
, icl_functions :: !.{# FunDef }
, icl_function_indices :: !IclFunctionIndices
, icl_common :: !.CommonDefs
, icl_import :: !{!Declaration}
, icl_qualified_imports :: ![([Declaration], ModuleN, Position)]
, icl_imported_instances :: ![!GlobalInstanceIndex!]
, icl_imported_objects :: ![ImportedObject]
, icl_foreign_exports :: ![ForeignExport]
, icl_used_module_numbers :: !NumberSet
......@@ -551,8 +550,8 @@ cIsImportedObject :== False
}
:: FieldSymbol =
{ fs_ident :: !Ident
, fs_var :: !Ident
{ fs_ident :: !Ident // IC_Field
, fs_var :: !Ident // IC_Expression
, fs_index :: !Index
}
......@@ -581,6 +580,11 @@ cIsAnalysed :== 4
}
NoGlobalIndex :== {gi_module=NoIndex,gi_index=NoIndex}
:: GlobalInstanceIndex =
{ gii_module_n ::!Int
, gii_instance_n ::!Int
}
:: TypeDef type_rhs =
{ td_ident :: !Ident
, td_index :: !Int
......@@ -1018,8 +1022,8 @@ cNotVarNumber :== -1
}
:: SelectorDef =
{ sd_ident :: !Ident
, sd_field :: !Ident
{ sd_ident :: !Ident // IC_Selector
, sd_field :: !Ident // IC_Field
, sd_type :: !SymbolType
, sd_exi_vars :: ![ATypeVar]
, sd_field_nr :: !Int
......
......@@ -3,7 +3,7 @@ definition module type
import StdArray
import syntax, check
typeProgram :: !{! Group} !Int !*{# FunDef} !IndexRange !(Optional Bool) !CommonDefs !{!Declaration} ![([Declaration], Int, Position)] !{# DclModule} !NumberSet
typeProgram :: !{! Group} !Int !*{# FunDef} !IndexRange !(Optional Bool) !CommonDefs ![!GlobalInstanceIndex!] !{# DclModule} !NumberSet
!*TypeDefInfos !*Heaps !*PredefinedSymbols !*File !*File
-> (!Bool, !*{# FunDef}, !ArrayAndListInstances, !{# CommonDefs}, !{# {# FunType} }, !*TypeDefInfos,!*Heaps,!*PredefinedSymbols,!*File,!*File)
......
......@@ -2534,10 +2534,10 @@ addLiftedArgumentsToSymbolType st=:{st_arity,st_args,st_args_strictness,st_vars,
, fe_location :: !IdentPos
}
typeProgram :: !{! Group} !Int !*{# FunDef} !IndexRange !(Optional Bool) !CommonDefs !{!Declaration} ![([Declaration], Int, Position)] !{# DclModule} !NumberSet
typeProgram :: !{! Group} !Int !*{# FunDef} !IndexRange !(Optional Bool) !CommonDefs ![!GlobalInstanceIndex!] !{# DclModule} !NumberSet
!*TypeDefInfos !*Heaps !*PredefinedSymbols !*File !*File
-> (!Bool, !*{# FunDef}, !ArrayAndListInstances, !{# CommonDefs}, !{# {# FunType} }, !*TypeDefInfos,!*Heaps,!*PredefinedSymbols,!*File,!*File)
typeProgram comps main_dcl_module_n fun_defs specials list_inferred_types icl_defs imports icl_qualified_imports dcl_modules used_module_numbers
typeProgram comps main_dcl_module_n fun_defs specials list_inferred_types icl_defs icl_imported_instances dcl_modules used_module_numbers
td_infos heaps=:{hp_var_heap, hp_expression_heap, hp_type_heaps,hp_generic_heap} predef_symbols file out
#! fun_env_size = size fun_defs
......@@ -2546,8 +2546,7 @@ typeProgram comps main_dcl_module_n fun_defs specials list_inferred_types icl_de
ti_functions = {dcl_functions \\ {dcl_functions} <-: dcl_modules }
class_instances = { { IT_Empty \\ i <- [0 .. dec (size com_class_defs)] } \\ {com_class_defs} <-: ti_common_defs }
state = collect_imported_instances imports ti_common_defs ts_error class_instances hp_type_heaps.th_vars td_infos
state = collect_qualified_imported_instances icl_qualified_imports ti_common_defs state
state = collect_imported_instances icl_imported_instances ti_common_defs ts_error class_instances hp_type_heaps.th_vars td_infos
(ts_error, class_instances, th_vars, td_infos) = collect_and_check_instances (size icl_defs.com_instance_defs) ti_common_defs state
......@@ -2573,17 +2572,12 @@ typeProgram comps main_dcl_module_n fun_defs specials list_inferred_types icl_de
ts_td_infos, {hp_var_heap = ts_var_heap, hp_expression_heap = ts_expr_heap, hp_type_heaps = ts_type_heaps, hp_generic_heap=ts_generic_heap },
predef_symbols, ts_error.ea_file, out)
where
collect_imported_instances imports common_defs error class_instances type_var_heap td_infos
= foldlArraySt (collect_imported_instance common_defs) imports (error, class_instances, type_var_heap, td_infos)
collect_qualified_imported_instances icl_qualified_imports common_defs state
= foldSt (\ (declarations,_,_) state -> foldSt (collect_imported_instance common_defs) declarations state)
icl_qualified_imports state
collect_imported_instance common_defs (Declaration {decl_kind = STE_Imported STE_Instance mod_index, decl_index }) state
= update_instances_of_class common_defs mod_index decl_index state
collect_imported_instance common_defs _ state
= state
collect_imported_instances [!{gii_module_n,gii_instance_n}:imported_instances!] common_defs error class_instances type_var_heap td_infos
# (error, class_instances, type_var_heap, td_infos)
= update_instances_of_class common_defs gii_module_n gii_instance_n (error, class_instances, type_var_heap, td_infos)
= collect_imported_instances imported_instances common_defs error class_instances type_var_heap td_infos
collect_imported_instances [!!] common_defs error class_instances type_var_heap td_infos
= (error, class_instances, type_var_heap, td_infos)
collect_and_check_instances nr_of_instances common_defs state
= iFoldSt (update_instances_of_class common_defs main_dcl_module_n) 0 nr_of_instances state
......
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