aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/frontend.dcl2
-rw-r--r--frontend/frontend.icl5
-rw-r--r--main/compile.icl38
3 files changed, 21 insertions, 24 deletions
diff --git a/frontend/frontend.dcl b/frontend/frontend.dcl
index 9aa9678..a635875 100644
--- a/frontend/frontend.dcl
+++ b/frontend/frontend.dcl
@@ -38,5 +38,5 @@ from partition import ::Component(..),::ComponentMembers
}
instance == ListTypesKind
-frontEndInterface :: !FrontEndOptions !Ident !SearchPaths !{#DclModule} !*{#*{#FunDef}} !(Optional Bool) !*PredefinedSymbols !*HashTable (ModTimeFunction *Files) !*Files !*File !*File !*File !(Optional *File) !*Heaps
+frontEndInterface :: !(Optional (*File,{#Char},{#Char})) !FrontEndOptions !Ident !SearchPaths !{#DclModule} !*{#*{#FunDef}} !(Optional Bool) !*PredefinedSymbols !*HashTable (ModTimeFunction *Files) !*Files !*File !*File !*File !(Optional *File) !*Heaps
-> ( !Optional *FrontEndSyntaxTree,!*{#*{#FunDef}},!{#DclModule},!Int,!*PredefinedSymbols, !*HashTable, !*Files, !*File, !*File, !*File, !Optional *File, !*Heaps)
diff --git a/frontend/frontend.icl b/frontend/frontend.icl
index 1f8302b..8bac21b 100644
--- a/frontend/frontend.icl
+++ b/frontend/frontend.icl
@@ -25,10 +25,9 @@ frontSyntaxTree cached_dcl_macros cached_dcl_mods main_dcl_module_n predef_symbo
},cached_dcl_macros,cached_dcl_mods,main_dcl_module_n,predef_symbols,hash_table,files,error,io,out,tcl_file,heaps
)
-frontEndInterface :: !FrontEndOptions !Ident !SearchPaths !{#DclModule} !*{#*{#FunDef}} !(Optional Bool) !*PredefinedSymbols !*HashTable (ModTimeFunction *Files) !*Files !*File !*File !*File !(Optional *File) !*Heaps
+frontEndInterface :: !(Optional (*File,{#Char},{#Char})) !FrontEndOptions !Ident !SearchPaths !{#DclModule} !*{#*{#FunDef}} !(Optional Bool) !*PredefinedSymbols !*HashTable (ModTimeFunction *Files) !*Files !*File !*File !*File !(Optional *File) !*Heaps
-> ( !Optional *FrontEndSyntaxTree,!*{#*{#FunDef}},!{#DclModule},!Int,!*PredefinedSymbols, !*HashTable, !*Files, !*File, !*File, !*File, !Optional *File, !*Heaps)
-frontEndInterface options mod_ident search_paths cached_dcl_modules cached_dcl_macros list_inferred_types predef_symbols hash_table modtimefunction files error io out tcl_file heaps
- # (opt_file_dir_time,files) = fopenInSearchPaths mod_ident.id_name ".icl" search_paths FReadData modtimefunction files
+frontEndInterface opt_file_dir_time options mod_ident search_paths cached_dcl_modules cached_dcl_macros list_inferred_types predef_symbols hash_table modtimefunction files error io out tcl_file heaps
| case opt_file_dir_time of No -> True; _ -> False
# error = moduleCouldNotBeImportedError True mod_ident NoPos error
= (No,{},{},0,predef_symbols, hash_table, files, error, io, out, tcl_file, heaps)
diff --git a/main/compile.icl b/main/compile.icl
index e0c022f..e064874 100644
--- a/main/compile.icl
+++ b/main/compile.icl
@@ -1,6 +1,3 @@
-/*
- module owner: Ronny Wichers Schreur
-*/
implementation module compile
import StdEnv
@@ -8,7 +5,6 @@ import frontend
import backendinterface
import filesystem, CoclSystemDependent
import compilerSwitches
-//import RWSDebug
from CoclSystemDependent import DirectorySeparator, ensureCleanSystemFilesExists
@@ -34,14 +30,12 @@ splitBy char string
stringSize
= size string
-openTclFile :: !Bool !String !*File !*Files -> (!Bool, !Optional .File, !*File, !*Files)
-openTclFile False icl_mod_pathname error files
- = (True,No,error,files)
-openTclFile compile_for_dynamics icl_mod_pathname error files
+openTclFile :: !String !String !*File !*Files -> (!Bool, !Optional .File, !*File, !*Files)
+openTclFile mod_name mod_path error files
# csf_path
- = directoryName icl_mod_pathname +++ "Clean System Files"
+ = mod_path +++ {DirectorySeparator} +++ "Clean System Files"
# tcl_path
- = csf_path +++ {DirectorySeparator} +++ baseName icl_mod_pathname +++ ".tcl"
+ = csf_path +++ {DirectorySeparator} +++ mod_name +++ ".tcl"
# (opened, tcl_file, files)
= fopen tcl_path FWriteData files
| opened
@@ -239,7 +233,7 @@ openPath path mode files
= fopen path mode files
compileModule :: CoclOptions [{#Char}] *DclCache *Files -> (!Bool,!*DclCache,!*Files)
-compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,predef_symbols,hash_table,heaps} files
+compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,predef_symbols,hash_table,heaps} files
# (opened, error, files)
= openPath options.errorPath options.errorMode files
| not opened
@@ -248,27 +242,31 @@ compileModule options backendArgs cache=:{dcl_modules,functions_and_macros,prede
= openPath options.outPath options.outMode files
| not opened
= abort ("couldn't open out file \"" +++ options.outPath +++ "\"\n")
- # (optional_tcl_opened, tcl_file, error, files)
- = openTclFile options.compile_for_dynamics options.pathName error files
+ # (opt_file_dir_time,files) = fopenInSearchPaths options.moduleName ".icl" options.searchPaths FReadData fmodificationtime files
+ # (opt_file_dir_time, optional_tcl_opened, tcl_file, error, files)
+ = case opt_file_dir_time of
+ Yes (_,mod_path,_)
+ | options.compile_for_dynamics
+ # (optional_tcl_opened, tcl_file, error, files) = openTclFile options.moduleName mod_path error files
+ -> (opt_file_dir_time, optional_tcl_opened, tcl_file, error, files)
+ _
+ -> (opt_file_dir_time, True,No,error,files)
| not optional_tcl_opened
- # (closed, files)
- = fclose out files
+ # (closed, files) = fclose out files
| not closed
= abort ("couldn't close stdio")
- # (closed, files)
- = fclose error files
+ # (closed, files) = fclose error files
| not closed
= abort ("couldn't close out file \"" +++ options.outPath +++ "\"\n")
= (False, cache, files)
- # (io, files)
- = stdio files
+ # (io, files) = stdio files
# ({boxed_ident=moduleIdent}, hash_table) = putIdentInHashTable options.moduleName (IC_Module NoQualifiedIdents) hash_table
# list_inferred_types
= if (options.listTypes.lto_listTypesKind == ListTypesInferred)
(Yes options.listTypes.lto_showAttributes)
No
# (optionalSyntaxTree,cached_functions_and_macros,cached_dcl_mods,main_dcl_module_n,predef_symbols, hash_table, files, error, io, out,tcl_file,heaps)
- = frontEndInterface
+ = frontEndInterface opt_file_dir_time
{feo_up_to_phase=FrontEndPhaseAll
,feo_generics=options.compile_with_generics
,feo_fusion=options.compile_with_fusion