Commit 2f562b3d authored by John van Groningen's avatar John van Groningen
Browse files

use path returned by fopenInSearchPaths to create the .tcl file name for openTclFile

parent de8edf67
......@@ -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)
......@@ -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)
......
/*
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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment