diff options
-rw-r--r-- | frontend/check.icl | 18 | ||||
-rw-r--r-- | frontend/explicitimports.dcl | 3 | ||||
-rw-r--r-- | frontend/explicitimports.icl | 11 |
3 files changed, 22 insertions, 10 deletions
diff --git a/frontend/check.icl b/frontend/check.icl index 2e84968..a8a953b 100644 --- a/frontend/check.icl +++ b/frontend/check.icl @@ -1928,6 +1928,14 @@ updateExplImpInfo super_components mod_index dcls_import dcls_local_for_import dcl_modules expl_imp_infos cs_symbol_table # (changed_symbols, (expl_imp_infos, cs_symbol_table)) = mapSt markExplImpSymbols super_components (expl_imp_infos, cs_symbol_table) + cs_symbol_table + = switch_import_syntax + (foldlArraySt opt_store_instance_with_class_symbol dcls_local_for_import cs_symbol_table) + cs_symbol_table + cs_symbol_table + = switch_import_syntax + (foldlArraySt opt_store_instance_with_class_symbol dcls_import cs_symbol_table) + cs_symbol_table (dcl_modules, expl_imp_infos, cs_symbol_table) = foldlArraySt (update_expl_imp_for_marked_symbol mod_index) dcls_local_for_import (dcl_modules, expl_imp_infos, cs_symbol_table) @@ -1939,6 +1947,16 @@ updateExplImpInfo super_components mod_index dcls_import dcls_local_for_import changed_symbols cs_symbol_table = (dcl_modules, expl_imp_infos, cs_symbol_table) + +opt_store_instance_with_class_symbol decl=:{dcl_kind=STE_Imported (STE_Instance class_ident) _} cs_symbol_table + /* This function is only for old import syntax. + All declared instances for a class have to be collected + */ + = optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table +opt_store_instance_with_class_symbol _ cs_symbol_table + = cs_symbol_table + + update_expl_imp_for_marked_symbol mod_index decl=:{dcl_ident} (dcl_modules, expl_imp_infos, cs_symbol_table) # (ste, cs_symbol_table) = readPtr dcl_ident.id_info cs_symbol_table diff --git a/frontend/explicitimports.dcl b/frontend/explicitimports.dcl index 86da888..fe0030a 100644 --- a/frontend/explicitimports.dcl +++ b/frontend/explicitimports.dcl @@ -19,6 +19,9 @@ markExplImpSymbols :: !Int !*(!*{!*{!u:ExplImpInfo}}, !*SymbolTable) updateExplImpForMarkedSymbol :: !Index !Declaration !SymbolTableEntry !u:{#DclModule} !{!{!*ExplImpInfo}} !*SymbolTable -> (!u:{#DclModule}, !{!{!.ExplImpInfo}}, !.SymbolTable) +optStoreInstanceWithClassSymbol :: Declaration !Ident !*SymbolTable + -> .SymbolTable + solveExplicitImports :: !(IntKeyHashtable [(Int,Position,[ImportNrAndIdents])]) !{#Int} !Index !*(!v:{#DclModule},!*{#Int},!{!*ExplImpInfo},!*CheckState) -> (!.SolvedImports,!(!v:{#DclModule},!.{#Int},!{!.ExplImpInfo},!.CheckState)) diff --git a/frontend/explicitimports.icl b/frontend/explicitimports.icl index 2763f05..3487eaa 100644 --- a/frontend/explicitimports.icl +++ b/frontend/explicitimports.icl @@ -70,16 +70,6 @@ updateExplImpForMarkedSymbol mod_index decl {ste_kind=STE_ExplImpComponentNrs co dcl_modules expl_imp_infos cs_symbol_table = foldSt (addExplImpInfo mod_index decl inst_indices) component_numbers (dcl_modules, expl_imp_infos, cs_symbol_table) -updateExplImpForMarkedSymbol _ decl {ste_kind=STE_Instance class_ident} dcl_modules expl_imp_infos cs_symbol_table - // this alternative is only for old syntax (cs_symbol_table argument is not necessary for new syntax) - # cs_symbol_table - = optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table - = (dcl_modules, expl_imp_infos, cs_symbol_table) -updateExplImpForMarkedSymbol _ decl {ste_kind=STE_Imported (STE_Instance class_ident) _} dcl_modules expl_imp_infos cs_symbol_table - // this alternative is only for old syntax (cs_symbol_table argument is not necessary for new syntax) - # cs_symbol_table - = optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table - = (dcl_modules, expl_imp_infos, cs_symbol_table) updateExplImpForMarkedSymbol _ _ entry dcl_modules expl_imp_infos cs_symbol_table = (dcl_modules, expl_imp_infos, cs_symbol_table) @@ -119,6 +109,7 @@ addExplImpInfo mod_index decl instances { cai_component_nr, cai_index } (dcl_mod ) +optStoreInstanceWithClassSymbol :: Declaration !Ident !*SymbolTable -> .SymbolTable optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table // this function is only for old syntax | switch_import_syntax False True |