diff options
author | johnvg | 2012-10-08 12:59:12 +0000 |
---|---|---|
committer | johnvg | 2012-10-08 12:59:12 +0000 |
commit | be1caa6b75c141b4e2221150b58d7d204f4efb4c (patch) | |
tree | 5219ea3991e7edb39ab637d8f8d1b69db2c0188f /main/compile.icl | |
parent | search and open file before calling wantModule (diff) |
use path returned by fopenInSearchPaths to create the .tcl file name for openTclFile
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2185 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'main/compile.icl')
-rw-r--r-- | main/compile.icl | 38 |
1 files changed, 18 insertions, 20 deletions
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 |