aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnvg2001-09-05 15:04:11 +0000
committerjohnvg2001-09-05 15:04:11 +0000
commit584f177a22d7f97ff7c7abd4e196510fb7e42edf (patch)
tree1af3ff6e1942e4b9b138840c10ad993691268723
parentfix parsing of [# with layout rule (diff)
moved function getBelongingSymbolsFromID from checksupport to explicitimports
moved function get_ident from checksupport to check git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@741 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--frontend/check.icl7
-rw-r--r--frontend/checksupport.dcl5
-rw-r--r--frontend/checksupport.icl14
-rw-r--r--frontend/explicitimports.icl6
4 files changed, 13 insertions, 19 deletions
diff --git a/frontend/check.icl b/frontend/check.icl
index d0c4911..f3bcd9e 100644
--- a/frontend/check.icl
+++ b/frontend/check.icl
@@ -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)
diff --git a/frontend/checksupport.dcl b/frontend/checksupport.dcl
index f694ae1..3214a3f 100644
--- a/frontend/checksupport.dcl
+++ b/frontend/checksupport.dcl
@@ -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}
diff --git a/frontend/checksupport.icl b/frontend/checksupport.icl
index 56025e0..b7d43ff 100644
--- a/frontend/checksupport.icl
+++ b/frontend/checksupport.icl
@@ -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
diff --git a/frontend/explicitimports.icl b/frontend/explicitimports.icl
index c178de9..99f5646 100644
--- a/frontend/explicitimports.icl
+++ b/frontend/explicitimports.icl
@@ -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))