Commit 23e66381 authored by John van Groningen's avatar John van Groningen

use type ModuleDirAndName instead of type String

parent 6868ed0a
This diff is collapsed.
......@@ -3,30 +3,29 @@ definition module PmFileInfo
import StdFile
import StdPathname
import UtilDate, UtilStrictLists
from PmTypes import :: Processor, :: Modulename, :: StaticLibInfo
from PmTypes import :: Processor, :: Modulename, :: StaticLibInfo, ::ModuleDirAndName
from PmAbcMagic import :: ABCCache, :: ABCOptions
:: FileInfoCache
:: FileInfo =
{ path :: !Pathname
{ fi_mod_name :: !{#Char}
, abcpath :: !Pathname
, objpath :: !Pathname
, sys :: !Bool // system file?
, seq_stack :: !Bool // sequential code & stack info?
, version :: !Int
, abcOptions :: !ABCOptions
, icldate :: !DATE
, abcdate :: !DATE
, objdate :: !DATE
}
FI_EmptyCache :: FileInfoCache
FI_GetFileInfo :: !Processor !Pathname !ABCCache !FileInfoCache !*env -> ((!ABCCache,!FileInfoCache, !FileInfo),!*env) | FileEnv env
FI_UpdateAbcDate :: !Pathname !Pathname !Bool !FileInfoCache !*Files -> ((!DATE,!FileInfoCache), !*Files)
FI_UpdateABCInfo :: !Pathname !Pathname !ABCCache !FileInfoCache !*Files -> ((!DATE,!ABCCache,!FileInfoCache), !*Files)
FI_UpdateObjDate :: !Pathname !Pathname !FileInfoCache !*Files -> (!FileInfoCache, !*Files)
FI_UpdateFileInfo :: !Pathname !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache
FI_GetFileInfo :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !*env -> ((!ABCCache,!FileInfoCache, !FileInfo),!*env) | FileEnv env
FI_UpdateAbcDate :: !Modulename !Pathname !Bool !FileInfoCache !*Files -> ((!DATE,!FileInfoCache), !*Files)
FI_UpdateABCInfo :: !Modulename !Pathname !ABCCache !FileInfoCache !*Files -> ((!DATE,!ABCCache,!FileInfoCache), !*Files)
FI_UpdateObjDate :: !Modulename !Pathname !FileInfoCache !*Files -> (!FileInfoCache, !*Files)
FI_UpdateFileInfo :: !Modulename !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache
FI_GetCleanModules :: !Pathname !StaticLibInfo !FileInfoCache -> (!List Pathname, !FileInfoCache)
YoungestObj :: !DATE !FileInfoCache -> DATE
......@@ -15,14 +15,13 @@ import PmAbcMagic
//--- FileInfo stuff
:: FileInfo =
{ path :: !Pathname
{ fi_mod_name :: !{#Char}
, abcpath :: !Pathname
, objpath :: !Pathname
, sys :: !Bool // system file?
, seq_stack :: !Bool // sequential code & stack info?
, version :: !Int // abc - version
, abcOptions :: !ABCOptions
, icldate :: !DATE
, abcdate :: !DATE
, objdate :: !DATE
}
......@@ -32,29 +31,24 @@ import PmAbcMagic
FI_EmptyCache :: FileInfoCache
FI_EmptyCache = Nil
FI_GetFileInfo :: !Processor !Pathname !ABCCache !FileInfoCache !*env -> ((!ABCCache,!FileInfoCache, !FileInfo),!*env) | FileEnv env
FI_GetFileInfo tp path abccache fileinfo ps
= accFiles (GetFileInfo1 tp path abccache fileinfo fileinfo) ps
FI_GetFileInfo :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !*env -> ((!ABCCache,!FileInfoCache, !FileInfo),!*env) | FileEnv env
FI_GetFileInfo tp mdn abccache fileinfo ps
= accFiles (GetFileInfo1 tp mdn abccache fileinfo fileinfo) ps
where
GetFileInfo1 :: !Processor !Pathname !ABCCache !FileInfoCache !FileInfoCache !Files
GetFileInfo1 :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !FileInfoCache !Files
-> ((!ABCCache,!FileInfoCache, !FileInfo), Files)
GetFileInfo1 tp this_path abccache fileinfo=:((info=:{path,abcpath,objpath}) :! rest) acc files
| this_path==path || this_path==abcpath || this_path==objpath
= ((abccache,acc, info), files)
= GetFileInfo1 tp this_path abccache rest acc files
GetFileInfo1 tp path abccache Nil acc files
# iclpath = MakeImpPathname path
// # (abcpath, files) = MakeABCSystemPathname path files
# abcpath = MakeABCSystemPathname path
// # (objpath, files) = MakeObjSystemPathname tp path files
# objpath = MakeObjSystemPathname tp path
# (icldate, files) = FModified iclpath files
GetFileInfo1 tp mdn=:{mdn_name} abccache (fileinfo:!rest) acc files
| mdn_name==fileinfo.fi_mod_name
= ((abccache,acc,fileinfo), files)
= GetFileInfo1 tp mdn abccache rest acc files
GetFileInfo1 tp mdn=:{mdn_name} abccache Nil acc files
# abcpath = ModuleDirAndNameToABCSystemPathname mdn
# objpath = ModuleDirAndNameToObjSystemPathname tp mdn
# (abcdate, files) = FModified abcpath files
# (objdate, files) = FModified objpath files
| not abcdate.exists
# finfo = { path = iclpath,
# finfo = { fi_mod_name = mdn_name,
abcpath = abcpath, objpath = objpath,
icldate = icldate,
abcdate = abcdate, objdate = objdate,
sys = False, seq_stack = False,
version = -1, abcOptions = DefaultABCOptions }
......@@ -62,33 +56,33 @@ where
// otherwise
# ((sys,seq_stack,version,abcOptions,abccache),files)
= GetABCCompiledInfo False abcpath abccache files
finfo = { path = iclpath,
finfo = { fi_mod_name = mdn_name,
abcpath = abcpath, objpath = objpath,
icldate = icldate,
abcdate = abcdate, objdate = objdate,
sys = sys, seq_stack = seq_stack,
version = version, abcOptions = abcOptions }
= ((abccache,finfo:!acc, finfo), files)
FI_UpdateFileInfo :: !Pathname !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache
FI_UpdateFileInfo key update list = UpdateFileInfo1 key update list Nil
FI_UpdateFileInfo :: !Modulename !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache
FI_UpdateFileInfo module_name update list = UpdateFileInfo1 module_name update list Nil
where
UpdateFileInfo1 :: !Pathname !(FileInfo -> FileInfo) !FileInfoCache !FileInfoCache -> FileInfoCache
UpdateFileInfo1 key update_function Nil acc
UpdateFileInfo1 module_name update_function Nil acc
= acc
UpdateFileInfo1 key update_function ((first=:{path,abcpath,objpath}):!rest) acc
| key == path || key == abcpath || key == objpath
UpdateFileInfo1 module_name update_function ((first=:{fi_mod_name}):!rest) acc
| fi_mod_name == module_name
= Reverse2 (update_function first:!rest) acc
= UpdateFileInfo1 key update_function rest (first:!acc)
FI_UpdateAbcDate :: !Pathname !Pathname !Bool !FileInfoCache !*Files -> ((!DATE,!FileInfoCache), !*Files)
FI_UpdateAbcDate path abcPath abcTimeProfile fileInfo files
# (abcDate, files) = FModified abcPath files
# fileInfo = FI_UpdateFileInfo path (\info -> {info & abcpath=abcPath, abcdate=abcDate, abcOptions = {info.abcOptions & abcTimeProfile = abcTimeProfile}}) fileInfo
= ((abcDate,fileInfo), files)
= UpdateFileInfo1 module_name update_function rest (first:!acc)
FI_UpdateABCInfo :: !Pathname !Pathname !ABCCache !FileInfoCache !*Files -> ((!DATE,!ABCCache,!FileInfoCache), !*Files)
FI_UpdateABCInfo path abcPath abcCache fileInfo files
FI_UpdateAbcDate :: !Modulename !Pathname !Bool !FileInfoCache !*Files -> ((!DATE,!FileInfoCache), !*Files)
FI_UpdateAbcDate module_name abcPath abcTimeProfile fileInfo files
# (abcDate, files) = FModified abcPath files
# update = \info -> {info & abcpath=abcPath, abcdate=abcDate, abcOptions.abcTimeProfile = abcTimeProfile}
fileInfo = FI_UpdateFileInfo module_name update fileInfo
= ((abcDate,fileInfo), files)
FI_UpdateABCInfo :: !Modulename !Pathname !ABCCache !FileInfoCache !*Files -> ((!DATE,!ABCCache,!FileInfoCache), !*Files)
FI_UpdateABCInfo module_name abcPath abcCache fileInfo files
# (abcDate,files) = FModified abcPath files
((sys,stack,version,abcOptions,abcCache), files)
= GetABCCompiledInfo True abcPath abcCache files
......@@ -101,18 +95,14 @@ FI_UpdateABCInfo path abcPath abcCache fileInfo files
, version = version
, abcOptions = abcOptions
}
fileInfo = FI_UpdateFileInfo path update fileInfo
fileInfo = FI_UpdateFileInfo module_name update fileInfo
= ((abcDate,abcCache,fileInfo),files)
FI_UpdateObjDate :: !Pathname !Pathname !FileInfoCache !*Files -> (!FileInfoCache, !*Files)
FI_UpdateObjDate path objPath fileInfo files
# (objDate, files) = FModified objPath files
update = \finfo ->
{ finfo
& objpath = objPath
, objdate = objDate
}
fileInfo = FI_UpdateFileInfo path update fileInfo
FI_UpdateObjDate :: !Modulename !Pathname !FileInfoCache !*Files -> (!FileInfoCache, !*Files)
FI_UpdateObjDate module_name objPath fileInfo files
# (objDate, files) = FModified objPath files
update = \finfo -> {finfo & objpath = objPath, objdate = objDate}
fileInfo = FI_UpdateFileInfo module_name update fileInfo
= (fileInfo,files)
FI_GetCleanModules :: !Pathname !StaticLibInfo !FileInfoCache -> (!List Pathname, !FileInfoCache)
......
......@@ -4,7 +4,7 @@ definition module PmPath
import StdFile, StdOverloaded//, StdString
import StdPathname
from UtilStrictLists import :: List
from PmTypes import :: Modulename, :: Processor
from PmTypes import :: Modulename, :: Processor, ::ModuleDirAndName
IsDefPathname :: !Pathname -> Bool;
IsImpPathname :: !Pathname -> Bool;
......@@ -22,7 +22,12 @@ MakeABCSystemPathname :: !Pathname -> Pathname
MakeObjSystemPathname :: !Processor !Pathname -> Pathname
MakeAssemblySystemPathname :: !Pathname -> Pathname
ModuleDirAndNameToImpPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToABCSystemPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToObjSystemPathname :: !Processor !ModuleDirAndName -> Pathname
GetModuleName :: !Pathname -> Modulename;
determine_dir_and_filename :: !{#Char} !(List {#Char}) -> (!ModuleDirAndName,!{#Char})
/* The name of the system directory */
SystemDir :== "Clean System Files";
......
......@@ -36,18 +36,7 @@ MakeABCPathname name = RemoveSuffix name +++ ".abc";
MakeObjPathname :: !Processor !String -> Pathname;
MakeObjPathname processor name
= RemoveSuffix name +++ ProcessorSuffix processor
/*
| processor == CurrentProcessor
// = RemoveSuffix name +++ ".o";
= RemoveSuffix name +++ ".xo";
| processor == MC68000
= RemoveSuffix name +++ ".obj0";
| processor == MC68020
= RemoveSuffix name +++ ".obj1";
| processor == MC68020_and_68881
= RemoveSuffix name +++ ".obj2";
= abort ("MakeObjPathname: " +++ toString processor +++ " : No such processor ");
*/
MakeProjectPathname :: !String -> Pathname;
MakeProjectPathname name = RemoveSuffix name +++ ".prj";
......@@ -68,6 +57,65 @@ MakeSystemPathname pathname
where
sep = toString DirSeparator;
ModuleDirAndNameToImpPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToImpPathname {mdn_dir,mdn_name}
= MakeFullPathname mdn_dir (replace_dot_chars_by_dir_separators mdn_name +++ ".icl")
replace_dot_chars_by_dir_separators :: !{#Char} -> {#Char}
replace_dot_chars_by_dir_separators module_name
# last_dot_i=find_last_dot_i module_name
| last_dot_i<0
= module_name
= {if (c=='.') DirSeparator c \\ c<-:module_name & i<-[0..]}
ModuleDirAndNameToABCSystemPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToABCSystemPathname {mdn_dir,mdn_name}
= make_clean_system_files_path mdn_dir mdn_name ".abc"
ModuleDirAndNameToObjSystemPathname :: !Processor !ModuleDirAndName -> Pathname
ModuleDirAndNameToObjSystemPathname processor {mdn_dir,mdn_name}
= make_clean_system_files_path mdn_dir mdn_name (ProcessorSuffix processor)
make_clean_system_files_path dir module_name file_ext
# last_dot_i=find_last_dot_i module_name
| last_dot_i<0
= directory_name_plus_system_dir_from_dir dir+++DirSeparatorString+++module_name+++file_ext
with
directory_name_plus_system_dir_from_dir dir
| equal_suffix SystemDir dir
= dir;
| size dir>0 && dir.[size dir-1]==DirSeparator
= dir +++ SystemDir;
| otherwise
= dir +++ DirSeparatorString +++ SystemDir;
# (subdir,file_name) = subdir_and_file_name_of_hmodule_name last_dot_i module_name file_ext
= directory_name_without_system_dir_with_separator_from_dir dir+++subdir+++DirSeparatorString+++SystemDir+++DirSeparatorString+++file_name
with
directory_name_without_system_dir_with_separator_from_dir dir
| equal_suffix SystemDir dir
= dir % (0,size dir-1-size SystemDir)+++DirSeparatorString
| size dir>0 && dir.[size dir-1]==DirSeparator
= dir
| otherwise
= dir+++DirSeparatorString;
find_last_dot_i :: !{#Char} -> Int
find_last_dot_i s
= find_last_dot_i s (size s-1)
where
find_last_dot_i s i
| i>=0
| s.[i]=='.'
= i
= find_last_dot_i s (i-1)
= i
subdir_and_file_name_of_hmodule_name :: !Int !{#Char} !{#Char} -> (!*{#Char},!{#Char})
subdir_and_file_name_of_hmodule_name last_dot_i mod file_ext
# subdir_name = {if (c=='.') DirSeparator c \\ i<-[0..last_dot_i-1] & c<-:mod}
file_name = mod % (last_dot_i+1,size mod-1)+++file_ext
= (subdir_name,file_name)
MakeABCSystemPathname :: !Pathname -> Pathname
MakeABCSystemPathname abcname
= directory_name_plus_system_dir +++ sep +++ file +++ ".abc"
......@@ -167,6 +215,34 @@ where
GetModuleName :: !Pathname -> Modulename;
GetModuleName name = RemoveSuffix (RemovePath name);
determine_dir_and_filename :: !{#Char} !(List {#Char}) -> (!ModuleDirAndName,!{#Char})
determine_dir_and_filename imp_pathname dirs
= determine_dir_and_filename dirs ""
where
determine_dir_and_filename (dir:!dirs) longest_dir
# sd=size dir
| sd>size longest_dir && sd<size imp_pathname && imp_pathname % (0,sd-1)==dir
= determine_dir_and_filename dirs dir
= determine_dir_and_filename dirs longest_dir
determine_dir_and_filename Nil longest_dir
| size longest_dir==0
# mdn = {mdn_dir = RemoveFilename imp_pathname, mdn_name = GetModuleName imp_pathname}
= (mdn,imp_pathname)
# (module_name,imp_pathname) = module_name_and_pathname_with_dots imp_pathname (size longest_dir)
# mdn = {mdn_dir = longest_dir, mdn_name = module_name}
= (mdn,imp_pathname)
module_name_and_pathname_with_dots pathname filename_i
| filename_i<size pathname && pathname.[filename_i]==DirSeparator
= module_name_and_pathname_with_dots pathname (filename_i+1)
# module_name = replace_dir_separators_by_dots (RemoveSuffix (pathname % (filename_i,size pathname-1)))
#! file_ext_i = filename_i+size module_name
# pathname = {if (i<filename_i || i>=file_ext_i) c module_name.[i-filename_i] \\ c<-:pathname & i<-[0..]}
= (module_name,pathname)
replace_dir_separators_by_dots s
= {if (c==DirSeparator) '.' c \\ c<-:s}
//==
symPath :: !Pathname !Pathname !Pathname -> Pathname
......
......@@ -52,7 +52,7 @@ PR_ProjectSet :: !Project -> Bool
PR_NewProject :: !String !EditWdOptions !CompilerOptions !CodeGenOptions !ApplicationOptions
!(List String) !LinkOptions -> Project
PR_SetBuilt :: !(List Modulename) !.Project -> .Project
PR_SetBuilt :: ![!ModuleDirAndName] !.Project -> .Project
PR_ClearDependencies :: !Project -> Project
PR_SetRoot :: !String !EditWdOptions !CompilerOptions !Project -> Project
PR_SetCompiled :: !Modulename !Project -> Project
......@@ -71,9 +71,11 @@ PR_GetPaths :: !Project -> List String
PR_GetRootModuleName :: !Project -> String
PR_GetRootPathName :: !Project -> (!String,!Project)
PR_GetRootModuleDir :: !Project -> String
PR_GetRootModuleDirAndName :: !Project -> (!ModuleDirAndName,!Project)
PR_GetRootDir :: !Project -> String
PR_GetRelativeRootDir :: !Project -> String
PR_GetModulenames :: !Bool !Def_and_Imp !Project -> (List String,Project)
PR_GetDirAndModulenames :: !Project -> ([!ModuleDirAndName],Project)
PR_GetOpenModulenames :: !Project -> List String
PR_GetModuleStuff :: !Project -> List (Modulename,String,Modulename,String)
......@@ -92,7 +94,7 @@ PR_UpdateModules :: ![Modulename] !(ModInfo -> ModInfo) !Project -> Project
PR_SetLinkOptions :: !Project !LinkOptions -> Project
PR_GetLinkOptions :: !Project -> LinkOptions
PR_AddABCInfo :: !String !(List LinkObjFileName) !(List LinkLibraryName)
PR_AddABCInfo :: !ModuleDirAndName !(List LinkObjFileName) !(List LinkLibraryName)
!CompilerOptions !EditWdOptions !EditWdOptions !Project -> Project
PR_GetABCLinkInfo :: !Project -> ABCLinkInfo
......
......@@ -128,12 +128,11 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
, root_directory = dirname
}
PR_SetBuilt :: !(List Modulename) !.Project -> .Project;
PR_SetBuilt :: ![!ModuleDirAndName] !.Project -> .Project;
PR_SetBuilt used project=:{inflist=Nil}
= {Project | project & built = True};
PR_SetBuilt used prj=:{inflist=infl=:(root:!rest),saved}
#! len = LLength rest
# used = Map GetModuleName used
# rest = RemoveUnusedModules used rest
# len` = LLength rest
# unchanged = len == len`
......@@ -142,19 +141,20 @@ where
{mn=rootmn,info} = root
RemoveUnusedModules used list = FilterR member list
where
member {mn} = StringOccurs mn used && rootmn <> mn
member {mn} = module_occurs mn used && rootmn <> mn
PR_AddABCInfo :: !String !(List LinkObjFileName) !(List LinkLibraryName) !CompilerOptions !EditWdOptions !EditWdOptions !Project -> Project
PR_AddABCInfo mod_path dep_objects dep_libraries compilerOptions defeo impeo project=:{inflist=Nil}
module_occurs :: !String ![!ModuleDirAndName] -> Bool
module_occurs s [|x:xs] = x.mdn_name == s || module_occurs s xs
module_occurs s [!] = False
PR_AddABCInfo :: !ModuleDirAndName !(List LinkObjFileName) !(List LinkLibraryName) !CompilerOptions !EditWdOptions !EditWdOptions !Project -> Project
PR_AddABCInfo mdn dep_objects dep_libraries compilerOptions defeo impeo project=:{inflist=Nil}
= project
PR_AddABCInfo mod_path dep_objects dep_libraries compilerOptions defeo impeo project=:{inflist}
PR_AddABCInfo {mdn_dir=mod_dir,mdn_name=mod_name} dep_objects dep_libraries compilerOptions defeo impeo project=:{inflist}
# inflist = TryInsertInList mod_name mod_dir inflist
# (inflist,_) = UpdateList mod_name update inflist;
= {project & saved=False,inflist=inflist, built=False}
where
mod_name = GetModuleName mod_path
mod_dir = RemoveFilename mod_path
update infListItem=:{InfListItem | info}
= ( { InfListItem | infListItem
& info.abcLinkInfo.linkObjFileNames = dep_objects
......@@ -390,6 +390,14 @@ PR_GetRootModuleDir {inflist={mn,info={dir}}:!rest}
= EmptyPathname;
= dir;
PR_GetRootModuleDirAndName :: !Project -> (!ModuleDirAndName,!Project)
PR_GetRootModuleDirAndName p=:{inflist=Nil}
= ({mdn_dir=EmptyPathname,mdn_name=""},p)
PR_GetRootModuleDirAndName p=:{inflist={mn,info={dir}}:!rest}
| size dir==0
= ({mdn_dir=EmptyPathname,mdn_name=""},p)
= ({mdn_dir=dir,mdn_name=mn},p)
PR_GetRootDir :: !Project -> String
PR_GetRootDir {root_directory}
= root_directory;
......@@ -410,6 +418,16 @@ where
| full = MakeFullPathname dir (MakeImpPathname mn)
= mn
PR_GetDirAndModulenames :: !Project -> ([!ModuleDirAndName],Project)
PR_GetDirAndModulenames project=:{inflist}
# modnames = get_dir_and_module_names_r inflist [|]
= (modnames,project)
where
get_dir_and_module_names_r ({mn,info={dir}}:!inflist) r
= get_dir_and_module_names_r inflist [|{mdn_dir=dir,mdn_name=mn}:r]
get_dir_and_module_names_r Nil r
= r
PR_GetOpenModulenames :: !Project -> List String
PR_GetOpenModulenames project=:{inflist}
= FlattenList modnames
......
......@@ -10,6 +10,8 @@ import UtilDate
:: Modulename :== String
:: ModuleDirAndName = {mdn_dir :: !{#Char}, mdn_name :: !{#Char}}
:: Processor //= CurrentProcessor | MC68000 | MC68020 | MC68020_and_68881
DefaultProcessor :: Processor
PlatformProcessors :: [Processor]
......
......@@ -48,6 +48,7 @@ Compile :: // Compiles the given file:
!(WindowFun *env) // error display fun
!(WindowFun *env) // types display fun
!CompileOrCheckSyntax // check syntax only?
!ModuleDirAndName
!Pathname // full .icl pathname of module to be compiled
!(List Pathname) // list of paths where compiler can find imported .dcl files
!Bool // project memory profiling?
......@@ -155,7 +156,7 @@ CompileStartCommand ::
!CompilerProcessIds
!*env
-> (!Bool,!CompilerProcessIds,!*env) | FileEnv env
CompileHandleExitCode :: !Int !String !String !Int !(WindowFun *env) !(WindowFun *env) !Pathname
CompileHandleExitCode :: !Int !String !String !Int !(WindowFun *env) !(WindowFun *env) !ModuleDirAndName
!ListTypes !*env -> (!Pathname,!CompilerMsg,!*env) | FileEnv env
:: CompilePollCompletedResult = NoFinishedCompiler | UnknownFinishedCompiler | FinishedCompiler !Int !Int
......@@ -174,6 +175,7 @@ CompilePersistent ::
!(WindowFun *env) // errwin
!(WindowFun *env) // typewin
!CompileOrCheckSyntax // compileOrCheckSyntax
!ModuleDirAndName
!Pathname // path
!(List Pathname) // paths
!Bool // projectHeapProfiling
......
......@@ -162,12 +162,12 @@ where
//-- Synchronous compilation stuff...
Compile ::
!String !Bool !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !Pathname
!String !Bool !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !ModuleDirAndName !Pathname
!(List Pathname) !Bool !Bool !Bool !CompilerOptions !Pathname !CompilerProcessIds !*env
-> (!Pathname,!CompilerMsg,!CompilerProcessIds,!*env)
| FileEnv env
Compile
cocl` use_compiler_process_ids write_module_times errwin typewin compileOrCheckSyntax path paths projectMemoryProfiling
cocl` use_compiler_process_ids write_module_times errwin typewin compileOrCheckSyntax mdn path paths projectMemoryProfiling
projectTimeProfiling projectEagerOrDynamic co=:{CompilerOptions | listTypes}
startupdir compiler_process_ids ps
# (cocl_ok,cocl,cocldir) = mangleCompiler cocl` startupdir // platform dependant mangling...
......@@ -184,7 +184,7 @@ Compile
| not diditall
# ps = errwin (["Error: Unable to run compiler: "+++cocl +++ " :"+++toString exitcode]) ps
= ("",SyntaxError,compiler_process_ids,ps)
# (path,mess,env) = CompileHandleExitCode exitcode cocl tooltempdir dummy_slot errwin typewin path listTypes ps
# (path,mess,env) = CompileHandleExitCode exitcode cocl tooltempdir dummy_slot errwin typewin mdn listTypes ps
= (path,mess,compiler_process_ids,env)
where
dummy_slot = 0
......@@ -327,12 +327,12 @@ get_finished_compiler_id_and_exit_code = code {
//-- Persistent compilation stuff...synchronous for now...
CompilePersistent ::
!String !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !Pathname
!String !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !ModuleDirAndName !Pathname
!(List Pathname) !Bool !Bool !Bool !CompilerOptions !Pathname !*CompilingInfo !*env
-> (!*CompilingInfo,!(!*env, !Pathname, !CompilerMsg))
| FileEnv env
CompilePersistent
cocl` write_module_times errwin typewin compileOrCheckSyntax path paths projectHeapProfiling
cocl` write_module_times errwin typewin compileOrCheckSyntax mdn path paths projectHeapProfiling
projectTimeProfiling projectEagerOrDynamic co=:{CompilerOptions | listTypes}
startupdir cstate env
......@@ -352,7 +352,7 @@ CompilePersistent
| not compile_ok
# env = errwin ["Error: Unable to run compiler: "+++cocl +++ " :"+++toString exitcode] env
= (cstate,(env,"",SyntaxError))
# (path,mess,env) = CompileHandleExitCode exitcode cocl tooltempdir dummy_slot errwin typewin path listTypes env
# (path,mess,env) = CompileHandleExitCode exitcode cocl tooltempdir dummy_slot errwin typewin mdn listTypes env
= (cstate,(env,path,mess))
where
dummy_slot = 0
......@@ -375,10 +375,9 @@ CompileBuildCommand out_file_name errors_file_name compileOrCheckSyntax path pat
+++ " -RE "+++ quoted_string errors_file_name
+++ " -RO "+++ quoted_string out_file_name;
CompileHandleExitCode :: !Int !String !String !Int !(WindowFun *env) !(WindowFun *env) !Pathname
CompileHandleExitCode :: !Int !String !String !Int !(WindowFun *env) !(WindowFun *env) !ModuleDirAndName
!ListTypes !*env -> (!Pathname,!CompilerMsg,!*env) | FileEnv env
CompileHandleExitCode exitcode cocl startupdir slot errwin typewin path
listTypes ps
CompileHandleExitCode exitcode cocl startupdir slot errwin typewin mdn listTypes ps
# out_file_name = out_file_path tooltempdir slot
errors_file_name = errors_file_path tooltempdir slot
# ((type_text_not_empty,type_text),ps)
......@@ -392,7 +391,7 @@ CompileHandleExitCode exitcode cocl startupdir slot errwin typewin path
: if (errors == CompilerOK) ["Unable to open Errors file"] []
]) ps
)
# abcpath = MakeABCSystemPathname path
# abcpath = ModuleDirAndNameToABCSystemPathname mdn
ps = (if type_text_not_empty (typewin (StrictListToList type_text)) id) ps
ps = (if errors_and_messages_not_empty (errwin (StrictListToList errors_and_messages)) id) ps
errors = case exitcode of
......
Markdown is supported
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