diff options
-rw-r--r-- | frontend/check.icl | 8 | ||||
-rw-r--r-- | frontend/syntax.dcl | 10 | ||||
-rw-r--r-- | frontend/syntax.icl | 5 |
3 files changed, 11 insertions, 12 deletions
diff --git a/frontend/check.icl b/frontend/check.icl index c8d8a5e..bbf67bd 100644 --- a/frontend/check.icl +++ b/frontend/check.icl @@ -1468,8 +1468,8 @@ replace_icl_macros_by_dcl_macros _ {ir_from=first_icl_macro_index,ir_to=end_icl_ (<=<) infixl (<=<) state fun :== fun state -checkDclModules :: [.(Import .ImportDeclaration)] *{#.DclModule} *{#*{#.FunDef}} *Heaps *CheckState - -> (Int,[ExplicitImport],.[{#Char}],{!{!.ExplImpInfo}}, .{# DclModule},.{#.{# FunDef}},.Heaps,.CheckState) +checkDclModules :: [Import] *{#DclModule} *{#*{#FunDef}} *Heaps *CheckState + -> (Int,[ExplicitImport],.[{#Char}],{!{!.ExplImpInfo}}, *{#DclModule},*{#*{#FunDef}},*Heaps,*CheckState) checkDclModules imports_of_icl_mod dcl_modules macro_defs heaps cs=:{cs_symbol_table} #! nr_of_dcl_modules = size dcl_modules # (bitvect, dependencies, dcl_modules, cs_symbol_table) @@ -1537,7 +1537,7 @@ checkDclModules imports_of_icl_mod dcl_modules macro_defs heaps cs=:{cs_symbol_t = (No, (already_visited, cs_symbol_table)) = (Yes ste_index, (bitvectSet ste_index already_visited, cs_symbol_table)) - set_to_false :: (Import x) !(!*LargeBitvect, !u:SymbolTable) -> (!.LargeBitvect, !u:SymbolTable) + set_to_false :: Import !(!*LargeBitvect, !u:SymbolTable) -> (!.LargeBitvect, !u:SymbolTable) set_to_false {import_module} (bitvect, cs_symbol_table) #! ste_index = (sreadPtr import_module.id_info cs_symbol_table).ste_index = (bitvectReset ste_index bitvect, cs_symbol_table) @@ -2153,7 +2153,7 @@ check_module1 cdefs icl_global_function_range fun_defs optional_dcl_mod optional fill_macro_def_array i [dcl_macro_defs:macro_defs] a = fill_macro_def_array (i+1) macro_defs {a & [i]=dcl_macro_defs} -check_module2 :: Ident {#Char} [.ImportedObject] .[Import ImportDeclaration] [ParsedForeignExport] .ModuleKind !.IndexRange !.IndexRange !.IndexRange !Int +check_module2 :: Ident {#Char} [.ImportedObject] [Import] [ParsedForeignExport] .ModuleKind !.IndexRange !.IndexRange !.IndexRange !Int (Optional (Module a)) [Declaration] Bool Bool *{#FunDef} *{#*{#FunDef}} *{#DclModule} (CollectedDefinitions ClassInstance) *{#.Int} *Heaps *CheckState -> (!Bool,.IclModule,!.{#DclModule},.{!Group},!*{#*{#FunDef}},!Int,!.Heaps,!.{#PredefinedSymbol},!.Heap SymbolTableEntry,!.File,[String]); diff --git a/frontend/syntax.dcl b/frontend/syntax.dcl index ddd6ef0..c585a1f 100644 --- a/frontend/syntax.dcl +++ b/frontend/syntax.dcl @@ -458,16 +458,16 @@ cNameLocationDependent :== True , cim_index :: !Index // or -1-index } -:: Import from_symbol = +:: Import = { import_module :: !Ident - , import_symbols :: ![from_symbol] + , import_symbols :: ![ImportDeclaration] , import_file_position:: !Position // for error messages , import_qualified :: !Bool } -instance toString (Import from_symbol), AttributeVar, TypeAttribute, Annotation +instance toString Import, AttributeVar, TypeAttribute, Annotation -:: ParsedImport :== Import ImportDeclaration +:: ParsedImport :== Import :: ImportDeclaration = ID_Function !Ident | ID_Class !Ident !(Optional [Ident]) @@ -1431,7 +1431,7 @@ instance == ModuleKind, Ident instance <<< (Module a) | <<< a, ParsedDefinition, InstanceType, AttributeVar, TypeVar, SymbolType, Expression, Type, Ident, (Global object) | <<< object, Position, CaseAlt, AType, FunDef, ParsedExpr, TypeAttribute, (Bind a b) | <<< a & <<< b, FieldNameOrQualifiedFieldName, ParsedConstructor, (TypeDef a) | <<< a, TypeVarInfo, AttrVarInfo, - BasicValue, ATypeVar, TypeRhs, (Import from_symbol) | <<< from_symbol, ImportDeclaration, CasePatterns, + BasicValue, ATypeVar, TypeRhs, Import, ImportDeclaration, CasePatterns, (Optional a) | <<< a, ConsVariable, BasicType, Annotation, SelectorKind, Selection, SelectorDef, ConsDef, LocalDefs, FreeVar, ClassInstance, SignClassification, TypeCodeExpression, CoercionPosition, AttrInequality, LetBind, Declaration, STE_Kind, BoundVar, TypeSymbIdent, diff --git a/frontend/syntax.icl b/frontend/syntax.icl index ffc46fb..73b5fad 100644 --- a/frontend/syntax.icl +++ b/frontend/syntax.icl @@ -8,7 +8,7 @@ import syntax instance toString Ident where toString {id_name} = id_name -instance toString (Import from_symbol) +instance toString Import where toString {import_module} = toString import_module instance == FunctionOrMacroIndex @@ -819,9 +819,8 @@ where (<<<) file (AVI_CountVar _) = file <<< "AVI_CountVar" (<<<) file (AVI_SequenceNumber n) = file <<< "AVI_SequenceNumber " <<< n (<<<) file AVI_Collected = file <<< "AVI_Collected" - -instance <<< (Import from_symbol) | <<< from_symbol +instance <<< Import where (<<<) file {import_module, import_symbols} = file <<< "import " <<< import_module <<< import_symbols |