Commit 8908af8d authored by John van Groningen's avatar John van Groningen
Browse files

rename restoreHeap to restoreIdentSymbolPtr, add restoreIdentsSymbolPtrs

parent a54c10be
......@@ -1669,7 +1669,7 @@ checkDclModules imports_of_icl_mod dcl_modules macro_defs heaps cs=:{cs_symbol_t
get_expl_imp_symbols_of_component imports_of_icl_mod component (dcl_modules, cs_symbol_table)
# (expl_imp_symbols, _, expl_imp_indices, dcl_modules, cs_symbol_table)
= foldSt (get_expl_imp_symbols_of_module imports_of_icl_mod) component ([], 0, [], dcl_modules, cs_symbol_table)
cs_symbol_table = foldSt restoreHeap expl_imp_symbols cs_symbol_table
cs_symbol_table = restoreIdentsSymbolPtrs expl_imp_symbols cs_symbol_table
= (reverse expl_imp_symbols, reverse expl_imp_indices, (dcl_modules, cs_symbol_table))
get_expl_imp_symbols_of_module imports_of_icl_mod mod_index (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices_accu, dcl_modules, cs_symbol_table)
......@@ -1825,8 +1825,7 @@ checkDclComponent components_array components_importing_module_a expl_imp_indice
= markExplImpSymbols component_nr (expl_imp_infos, cs.cs_symbol_table)
(expl_imp_infos, dcl_modules, cs_symbol_table)
= foldSt collect_expl_imp_info_per_module mod_indices (expl_imp_infos, dcl_modules, cs_symbol_table)
cs_symbol_table
= foldSt restoreHeap changed_symbols cs_symbol_table
cs_symbol_table = restoreIdentsSymbolPtrs changed_symbols cs_symbol_table
= (expl_imp_infos, dcl_modules, { cs & cs_symbol_table = cs_symbol_table })
collect_expl_imp_info_per_module mod_index (expl_imp_infos, dcl_modules, cs_symbol_table)
......@@ -3038,8 +3037,7 @@ updateExplImpInfo components_importing_module mod_index dcls_import dcls_local_f
= update_expl_imp_for_marked_symbols mod_index dcls_local_for_import (dcl_modules, expl_imp_infos, cs_symbol_table)
(dcl_modules, expl_imp_infos, cs_symbol_table)
= update_expl_imp_for_marked_symbols mod_index dcls_import (dcl_modules, expl_imp_infos, cs_symbol_table)
cs_symbol_table
= foldSt (\l cs_symbol_table->foldSt restoreHeap l cs_symbol_table) changed_symbols cs_symbol_table
cs_symbol_table = foldSt restoreIdentsSymbolPtrs changed_symbols cs_symbol_table
= (dcl_modules, expl_imp_infos, cs_symbol_table)
updateExplImpInfoForCachedModule :: [Int] Index {!Declaration} {!Declaration} ExplImpInfos u:{#DclModule} *SymbolTable
......@@ -3064,7 +3062,7 @@ updateExplImpInfoForCachedModule components_importing_module mod_index dcls_impo
(dcl_modules, cs_symbol_table)
= unmark_belongings_of_expl_imp_symbols dcls_import dcl_modules__cs_symbol_table
cs_symbol_table = foldSt (\l cs_symbol_table->foldSt restoreHeap l cs_symbol_table) changed_symbols cs_symbol_table
cs_symbol_table = foldSt restoreIdentsSymbolPtrs changed_symbols cs_symbol_table
= (expl_imp_infos, dcl_modules, cs_symbol_table)
where
mark_belongings_of_expl_imp_symbols decls (dcl_modules, cs_symbol_table)
......
......@@ -139,4 +139,4 @@ getBelongingSymbols :: !Declaration !v:{#DclModule} -> (!BelongingSymbols, !v:{#
nrOfBelongingSymbols :: !BelongingSymbols -> Int
import_ident :: Ident
restoreHeap :: !Ident !*SymbolTable -> .SymbolTable
restoreIdentsSymbolPtrs :: ![Ident] !*SymbolTable -> *SymbolTable
......@@ -537,8 +537,10 @@ instance <<< DeclarationInfo
import_ident :: Ident
import_ident =: { id_name = "import", id_info = nilPtr }
restoreHeap :: !Ident !*SymbolTable -> .SymbolTable
restoreHeap {id_info} cs_symbol_table
# ({ste_previous}, cs_symbol_table)
= readPtr id_info cs_symbol_table
restoreIdentsSymbolPtrs :: ![Ident] !*SymbolTable -> *SymbolTable
restoreIdentsSymbolPtrs idents symbol_table = foldSt restoreIdentSymbolPtr idents symbol_table
restoreIdentSymbolPtr :: !Ident !*SymbolTable -> *SymbolTable
restoreIdentSymbolPtr {id_info} cs_symbol_table
# ({ste_previous}, cs_symbol_table) = readPtr id_info cs_symbol_table
= writePtr id_info ste_previous cs_symbol_table
......@@ -194,7 +194,7 @@ solveExplicitImports expl_imp_indices_ikh modules_in_component_set importing_mod
belongs_bitvect = bitvectCreate nr_of_belongs
(belongs_set, (cs_error, cs_symbol_table))
= mapFilterYesSt (get_opt_nr_and_ident position eii_ident) belongs (cs_error, cs_symbol_table)
cs_symbol_table = foldSt restoreHeap all_belongs cs_symbol_table
cs_symbol_table = restoreIdentsSymbolPtrs all_belongs cs_symbol_table
-> (True, belongs_set, cs_error, cs_symbol_table)
(decls_accu, dcl_modules, eii_declaring_modules, visited_modules, cs_error)
= foldSt
......
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