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

more changes caused by using type ModuleDirAndName instead of type String,

remove some unused functions and function arguments,
change order of some function arguments and tuples
parent 10f4ea83
This diff is collapsed.
...@@ -21,9 +21,8 @@ from PmAbcMagic import :: ABCCache, :: ABCOptions ...@@ -21,9 +21,8 @@ from PmAbcMagic import :: ABCCache, :: ABCOptions
} }
FI_EmptyCache :: FileInfoCache FI_EmptyCache :: FileInfoCache
FI_GetFileInfo :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !*env -> ((!ABCCache,!FileInfoCache, !FileInfo),!*env) | FileEnv env FI_GetFileInfo :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !*env -> (!(!FileInfo,!ABCCache,!FileInfoCache),!*env) | FileEnv env
FI_UpdateAbcDate :: !Modulename !Pathname !Bool !FileInfoCache !*Files -> ((!DATE,!FileInfoCache), !*Files) 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_UpdateObjDate :: !Modulename !Pathname !FileInfoCache !*Files -> (!FileInfoCache, !*Files)
FI_UpdateFileInfo :: !Modulename !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache FI_UpdateFileInfo :: !Modulename !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache
FI_GetCleanModules :: !Pathname !StaticLibInfo !FileInfoCache -> (!List Pathname, !FileInfoCache) FI_GetCleanModules :: !Pathname !StaticLibInfo !FileInfoCache -> (!List Pathname, !FileInfoCache)
......
...@@ -31,15 +31,15 @@ import PmAbcMagic ...@@ -31,15 +31,15 @@ import PmAbcMagic
FI_EmptyCache :: FileInfoCache FI_EmptyCache :: FileInfoCache
FI_EmptyCache = Nil FI_EmptyCache = Nil
FI_GetFileInfo :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !*env -> ((!ABCCache,!FileInfoCache, !FileInfo),!*env) | FileEnv env FI_GetFileInfo :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !*env -> (!(!FileInfo,!ABCCache,!FileInfoCache),!*env) | FileEnv env
FI_GetFileInfo tp mdn abccache fileinfo ps FI_GetFileInfo tp mdn abccache fileinfo ps
= accFiles (GetFileInfo1 tp mdn abccache fileinfo fileinfo) ps = accFiles (GetFileInfo1 tp mdn abccache fileinfo fileinfo) ps
where where
GetFileInfo1 :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !FileInfoCache !Files GetFileInfo1 :: !Processor !ModuleDirAndName !ABCCache !FileInfoCache !FileInfoCache !Files
-> ((!ABCCache,!FileInfoCache, !FileInfo), Files) -> (!(!FileInfo,!ABCCache,!FileInfoCache), Files)
GetFileInfo1 tp mdn=:{mdn_name} abccache (fileinfo:!rest) acc files GetFileInfo1 tp mdn=:{mdn_name} abccache (fileinfo:!rest) acc files
| mdn_name==fileinfo.fi_mod_name | mdn_name==fileinfo.fi_mod_name
= ((abccache,acc,fileinfo), files) = ((fileinfo,abccache,acc), files)
= GetFileInfo1 tp mdn abccache rest acc files = GetFileInfo1 tp mdn abccache rest acc files
GetFileInfo1 tp mdn=:{mdn_name} abccache Nil acc files GetFileInfo1 tp mdn=:{mdn_name} abccache Nil acc files
# abcpath = ModuleDirAndNameToABCSystemPathname mdn # abcpath = ModuleDirAndNameToABCSystemPathname mdn
...@@ -52,7 +52,7 @@ where ...@@ -52,7 +52,7 @@ where
abcdate = abcdate, objdate = objdate, abcdate = abcdate, objdate = objdate,
sys = False, seq_stack = False, sys = False, seq_stack = False,
version = -1, abcOptions = DefaultABCOptions } version = -1, abcOptions = DefaultABCOptions }
= ((abccache,finfo:!acc, finfo), files) = ((finfo,abccache,finfo:!acc), files)
// otherwise // otherwise
# ((sys,seq_stack,version,abcOptions,abccache),files) # ((sys,seq_stack,version,abcOptions,abccache),files)
= GetABCCompiledInfo False abcpath abccache files = GetABCCompiledInfo False abcpath abccache files
...@@ -61,7 +61,7 @@ where ...@@ -61,7 +61,7 @@ where
abcdate = abcdate, objdate = objdate, abcdate = abcdate, objdate = objdate,
sys = sys, seq_stack = seq_stack, sys = sys, seq_stack = seq_stack,
version = version, abcOptions = abcOptions } version = version, abcOptions = abcOptions }
= ((abccache,finfo:!acc, finfo), files) = ((finfo,abccache,finfo:!acc), files)
FI_UpdateFileInfo :: !Modulename !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache FI_UpdateFileInfo :: !Modulename !(FileInfo -> FileInfo) !FileInfoCache -> FileInfoCache
FI_UpdateFileInfo module_name update list = UpdateFileInfo1 module_name update list Nil FI_UpdateFileInfo module_name update list = UpdateFileInfo1 module_name update list Nil
...@@ -81,23 +81,6 @@ FI_UpdateAbcDate module_name abcPath abcTimeProfile fileInfo files ...@@ -81,23 +81,6 @@ FI_UpdateAbcDate module_name abcPath abcTimeProfile fileInfo files
fileInfo = FI_UpdateFileInfo module_name update fileInfo fileInfo = FI_UpdateFileInfo module_name update fileInfo
= ((abcDate,fileInfo), files) = ((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
update = \finfo ->
{ finfo
& abcpath = abcPath
, abcdate = abcDate
, sys = sys
, seq_stack = stack
, version = version
, abcOptions = abcOptions
}
fileInfo = FI_UpdateFileInfo module_name update fileInfo
= ((abcDate,abcCache,fileInfo),files)
FI_UpdateObjDate :: !Modulename !Pathname !FileInfoCache !*Files -> (!FileInfoCache, !*Files) FI_UpdateObjDate :: !Modulename !Pathname !FileInfoCache !*Files -> (!FileInfoCache, !*Files)
FI_UpdateObjDate module_name objPath fileInfo files FI_UpdateObjDate module_name objPath fileInfo files
# (objDate, files) = FModified objPath files # (objDate, files) = FModified objPath files
......
...@@ -18,10 +18,10 @@ MakeObjPathname :: !Processor !String -> Pathname; ...@@ -18,10 +18,10 @@ MakeObjPathname :: !Processor !String -> Pathname;
MakeProjectPathname :: !String -> Pathname; MakeProjectPathname :: !String -> Pathname;
MakeExecPathname :: !String -> Pathname; MakeExecPathname :: !String -> Pathname;
MakeSystemPathname :: !Pathname -> Pathname; MakeSystemPathname :: !Pathname -> Pathname;
MakeABCSystemPathname :: !Pathname -> Pathname
MakeObjSystemPathname :: !Processor !Pathname -> Pathname MakeObjSystemPathname :: !Processor !Pathname -> Pathname
MakeAssemblySystemPathname :: !Pathname -> Pathname MakeAssemblySystemPathname :: !Pathname -> Pathname
ModuleDirAndNameToDefPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToImpPathname :: !ModuleDirAndName -> Pathname ModuleDirAndNameToImpPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToABCSystemPathname :: !ModuleDirAndName -> Pathname ModuleDirAndNameToABCSystemPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToObjSystemPathname :: !Processor !ModuleDirAndName -> Pathname ModuleDirAndNameToObjSystemPathname :: !Processor !ModuleDirAndName -> Pathname
......
...@@ -61,6 +61,10 @@ ModuleDirAndNameToImpPathname :: !ModuleDirAndName -> Pathname ...@@ -61,6 +61,10 @@ ModuleDirAndNameToImpPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToImpPathname {mdn_dir,mdn_name} ModuleDirAndNameToImpPathname {mdn_dir,mdn_name}
= MakeFullPathname mdn_dir (replace_dot_chars_by_dir_separators mdn_name +++ ".icl") = MakeFullPathname mdn_dir (replace_dot_chars_by_dir_separators mdn_name +++ ".icl")
ModuleDirAndNameToDefPathname :: !ModuleDirAndName -> Pathname
ModuleDirAndNameToDefPathname {mdn_dir,mdn_name}
= MakeFullPathname mdn_dir (replace_dot_chars_by_dir_separators mdn_name +++ ".dcl")
replace_dot_chars_by_dir_separators :: !{#Char} -> {#Char} replace_dot_chars_by_dir_separators :: !{#Char} -> {#Char}
replace_dot_chars_by_dir_separators module_name replace_dot_chars_by_dir_separators module_name
# last_dot_i=find_last_dot_i module_name # last_dot_i=find_last_dot_i module_name
...@@ -115,21 +119,6 @@ subdir_and_file_name_of_hmodule_name last_dot_i mod file_ext ...@@ -115,21 +119,6 @@ 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} # 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 file_name = mod % (last_dot_i+1,size mod-1)+++file_ext
= (subdir_name,file_name) = (subdir_name,file_name)
MakeABCSystemPathname :: !Pathname -> Pathname
MakeABCSystemPathname abcname
= directory_name_plus_system_dir +++ sep +++ file +++ ".abc"
where
directory_name_plus_system_dir
| equal_suffix SystemDir dir
= dir;
| size dir > 0 && dir.[size dir - 1] == DirSeparator
= dir +++ SystemDir;
| otherwise
= dir +++ sep +++ SystemDir;
dir = RemoveFilename abcname;
sep = toString DirSeparator;
file = RemovePath (RemoveSuffix abcname);
MakeObjSystemPathname :: !Processor !Pathname -> Pathname MakeObjSystemPathname :: !Processor !Pathname -> Pathname
MakeObjSystemPathname processor name MakeObjSystemPathname processor name
...@@ -178,18 +167,6 @@ where ...@@ -178,18 +167,6 @@ where
".a" // Mac ".a" // Mac
/* /*
MakeABCSystemPathname :: !Pathname !Files -> (!Pathname,!Files);
MakeABCSystemPathname abcname files
= (directory_name_plus_system_dir +++ sep +++ file +++ ".abc",files);
where
directory_name_plus_system_dir
| equal_suffix SystemDir dir
= dir;
= dir +++ sep +++ SystemDir;
dir = RemoveFilename abcname;
sep = toString DirSeparator;
file = RemovePath (RemoveSuffix abcname);
MakeObjSystemPathname :: !Processor !Pathname !Files -> (!Pathname,!Files); MakeObjSystemPathname :: !Processor !Pathname !Files -> (!Pathname,!Files);
MakeObjSystemPathname processor name files MakeObjSystemPathname processor name files
| processor == CurrentProcessor | processor == CurrentProcessor
......
...@@ -441,8 +441,8 @@ where ...@@ -441,8 +441,8 @@ where
| impopen = impname :! Nil | impopen = impname :! Nil
= Nil = Nil
where where
defname = MakeFullPathname dir (MakeDefPathname mn) defname = ModuleDirAndNameToDefPathname {mdn_dir=dir,mdn_name=mn}
impname = MakeFullPathname dir (MakeImpPathname mn) impname = ModuleDirAndNameToImpPathname {mdn_dir=dir,mdn_name=mn}
PR_GetModuleStuff :: !Project -> List (Modulename,String,Modulename,String) PR_GetModuleStuff :: !Project -> List (Modulename,String,Modulename,String)
PR_GetModuleStuff project=:{inflist} PR_GetModuleStuff project=:{inflist}
...@@ -615,6 +615,9 @@ GetProject applicationDir project ...@@ -615,6 +615,9 @@ GetProject applicationDir project
post_link = case project.posl of post_link = case project.posl of
Just post_link -> Just (SubstitutePath applicationDir project_dir post_link) Just post_link -> Just (SubstitutePath applicationDir project_dir post_link)
Nothing -> Nothing Nothing -> Nothing
mainModuleName = PR_GetRootModuleName project
target = PR_GetTarget project
(otherModuleNames,project`) = PR_GetModulenames False IclMod project
mainModuleInfo = getModule project_dir mainModuleName mainModuleInfo = getModule project_dir mainModuleName
otherModules = Map (getModule project_dir) (Filter ((<>) mainModuleName) otherModuleNames) otherModules = Map (getModule project_dir) (Filter ((<>) mainModuleName) otherModuleNames)
linkOptions = SubstituteLinkOptionsPaths applicationDir project_dir (PR_GetLinkOptions project) linkOptions = SubstituteLinkOptionsPaths applicationDir project_dir (PR_GetLinkOptions project)
...@@ -640,17 +643,12 @@ where ...@@ -640,17 +643,12 @@ where
# xp = PR_GetExecPath project # xp = PR_GetExecPath project
= symPath applicationDir project_dir xp = symPath applicationDir project_dir xp
mainModuleName = PR_GetRootModuleName project
(otherModuleNames,project`) = PR_GetModulenames False IclMod project
getModule project_dir name getModule project_dir name
# info = PR_GetModuleInfo name project # info = PR_GetModuleInfo name project
# info = if (isJust info) (fromJust info) defaultModInfo # info = if (isJust info) (fromJust info) defaultModInfo
# info = SubstituteModuleInfoPaths applicationDir project_dir info # info = SubstituteModuleInfoPaths applicationDir project_dir info
= {name = name, info = info} = {name = name, info = info}
target = PR_GetTarget project
defaultModInfo :: ModInfo defaultModInfo :: ModInfo
defaultModInfo = defaultModInfo =
{ dir = EmptyPathname { dir = EmptyPathname
......
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