aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/check.icl22
-rw-r--r--frontend/parse.icl5
-rw-r--r--frontend/syntax.dcl5
3 files changed, 21 insertions, 11 deletions
diff --git a/frontend/check.icl b/frontend/check.icl
index c32e805..8ee537c 100644
--- a/frontend/check.icl
+++ b/frontend/check.icl
@@ -1859,15 +1859,19 @@ checkDclModules imports_of_icl_mod dcl_modules icl_functions macro_defs heaps cs
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 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_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_symbol imp_decl ident=:{id_info} (expl_imp_symbols_accu, nr_of_expl_imp_symbols, expl_imp_indices_accu, cs_symbol_table)
diff --git a/frontend/parse.icl b/frontend/parse.icl
index a3ca6d8..aca2b5d 100644
--- a/frontend/parse.icl
+++ b/frontend/parse.icl
@@ -1174,6 +1174,11 @@ wantImportDeclarationT token pState
# (fun_id, pState) = stringToIdent fun_name IC_Expression pState
(ii_extended, pState) = optional_extension pState
-> (ID_Function fun_id, pState)
+ GenericToken
+ # (name, pState) = want pState
+ (generic_id, pState) = stringToIdent name IC_Generic pState
+ (expr_id, pState) = stringToIdent name IC_Expression pState
+ -> (ID_Generic generic_id expr_id, pState)
token
# (fun_id, pState) = stringToIdent "dummy" IC_Expression pState
-> ( ID_Function fun_id
diff --git a/frontend/syntax.dcl b/frontend/syntax.dcl
index 34001ad..2d9b36e 100644
--- a/frontend/syntax.dcl
+++ b/frontend/syntax.dcl
@@ -373,8 +373,8 @@ cNameLocationDependent :== True
}
:: GenericDef =
- { gen_ident :: !Ident // the generics name in IC_Class
- , gen_member_ident :: !Ident // the generics name in IC_Member
+ { gen_ident :: !Ident // the generics name in IC_Generic
+ , gen_member_ident :: !Ident // the generics name in IC_Expression
, gen_pos :: !Position
, gen_type :: !SymbolType // Generic type (st_vars include generic type vars)
, gen_vars :: ![TypeVar] // Generic type variables
@@ -460,6 +460,7 @@ instance toString (Import from_symbol), AttributeVar, TypeAttribute, Annotation
| ID_Type !Ident !(Optional [Ident])
| ID_Record !Ident !(Optional [Ident])
| ID_Instance !Ident !Ident !(![Type],![TypeContext])
+ | ID_Generic !Ident !Ident
cIsImportedLibrary :== True
cIsImportedObject :== False