Commit bfb99888 authored by John van Groningen's avatar John van Groningen
Browse files

moved function getBelongingSymbolsFromID from checksupport to explicitimports

moved function get_ident from checksupport to check
parent 03c6bc8d
......@@ -1356,6 +1356,13 @@ checkDclModules imports_of_icl_mod dcl_modules icl_functions heaps cs=:{cs_symbo
= foldSt (get_symbol imp_decl) idents state
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_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)
......
......@@ -52,9 +52,7 @@ cConversionTableSize :== 9 // AA
:: CommonDefs =
{ com_type_defs :: !.{# CheckedTypeDef}
, com_unexpanded_type_defs :: !{# CheckedTypeDef}
, com_cons_defs :: !.{# ConsDef}
, com_selector_defs :: !.{# SelectorDef}
, com_class_defs :: !.{# ClassDef}
......@@ -177,9 +175,6 @@ newFreeVariable :: !FreeVar ![FreeVar] ->(!Bool, ![FreeVar])
local_declaration_for_import :: !u:Declaration .Index -> v:Declaration, [u <= v]
get_ident :: !ImportDeclaration -> Ident
getBelongingSymbolsFromID :: !ImportDeclaration -> Optional [ImportedIdent]
:: BelongingSymbols
= BS_Constructors ![DefinedSymbol]
| BS_Fields !{#FieldSymbol}
......
......@@ -540,20 +540,6 @@ local_declaration_for_import decl=:(Declaration {decl_kind=STE_Imported _ _}) mo
local_declaration_for_import decl=:(Declaration declaration_record=:{decl_kind}) module_n
= Declaration {declaration_record & decl_kind = STE_Imported decl_kind module_n}
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
getBelongingSymbolsFromID :: !ImportDeclaration -> Optional [ImportedIdent]
getBelongingSymbolsFromID (ID_Class _ x) = x
getBelongingSymbolsFromID (ID_Type _ x) = x
getBelongingSymbolsFromID (ID_Record _ x) = x
getBelongingSymbolsFromID _ = No
class toIdent a :: !a -> Ident
instance toIdent SymbIdent
......
......@@ -136,6 +136,12 @@ imp_decl_to_string (ID_OldSyntax idents) = "ID_OldSyntax "+++idents_to_string id
idents_to_string [{id_name}:l] = toString id_name+++","+++idents_to_string l
*/
getBelongingSymbolsFromID :: !ImportDeclaration -> Optional [ImportedIdent]
getBelongingSymbolsFromID (ID_Class _ x) = x
getBelongingSymbolsFromID (ID_Type _ x) = x
getBelongingSymbolsFromID (ID_Record _ x) = x
getBelongingSymbolsFromID _ = No
solveExplicitImports :: !(IntKeyHashtable [(Int,Position,[ImportNrAndIdents])]) !{#Int} !Index
!*(!v:{#DclModule},!*{#Int},!{!*ExplImpInfo},!*CheckState)
-> (!.SolvedImports,!(!v:{#DclModule},!.{#Int},!{!.ExplImpInfo},!.CheckState))
......
Markdown is supported
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