Commit dff36665 authored by John van Groningen's avatar John van Groningen

rename function PR_GetRootPath to PR_GetRootModuleDir

parent 85d8ebcd
......@@ -25,7 +25,7 @@ projectOptions ps
projectDefaults :: !(PSt General) -> PSt General
projectDefaults ps
= projectDialog False ps
projectDialog :: !Bool !(PSt General) -> PSt General
projectDialog actualProject ps`
# ((err,ret),ps) = (if actualProject actualOpenOptionsDialog actualOpenDefaultsDialog) ps
......@@ -108,7 +108,7 @@ where
lo = if actualProject (PR_GetLinkOptions project) prefs.linkopts
paths = PR_GetPaths project
sl = PR_GetStaticLibsInfo project
root_path = PR_GetRootPath project
root_path = PR_GetRootModuleDir project
(post_link,_) = PR_GetPostlink project
inils = {ao=ao,cgo=cgo,paths=paths,lo=lo,xp=fulexepath,sl=sl,post_link=post_link}
......@@ -611,6 +611,7 @@ where
# lo = ListToStrictList lo
# tg = {tg & paths = lo}
= ((full,tg),ps)
addPath ((full,tg),ps)
# (fs,ps) = selectDirectory` ps
| isNothing fs = ((full,tg),ps)
......@@ -618,6 +619,7 @@ where
tg = {tg & paths = Append tg.paths pathname}
ps = appendExtListBoxItems lbpadId (zip3 [FullPath full ap pp pathname](repeat id)(repeat id)) ps
= ((full,tg),ps)
removePath ((full,tg),ps)
# ((ok,sel),ps) = getExtListBoxSelection lbpadId ps
| not ok || isEmpty sel
......@@ -731,6 +733,7 @@ where
lbDn ((lo,full),ps)
# (_,(lo,ps)) = dnSelItem lb1Id (StrictListToList lo,ps)
= ((ListToStrictList lo,full),ps)
addPath ((lo,full),ps)
# (fs,ps) = selectDirectory` ps
| isNothing fs = ((lo,full),ps)
......@@ -738,6 +741,7 @@ where
# lo = Append lo pathname
# ps = appendExtListBoxItems lb1Id (zip3 [FullPath full ap pp pathname](repeat id)(repeat id)) ps
= ((lo,full),ps)
removePath ((lo,full),ps)
# ((ok,sel),ps) = getExtListBoxSelection lb1Id ps
| not ok || isEmpty sel = ((lo,full),ps)
......
......@@ -62,8 +62,8 @@ PR_GetCodeGenOptions :: !Project -> CodeGenOptions
PR_GetApplicationOptions :: !Project -> ApplicationOptions
PR_GetPaths :: !Project -> List String
PR_GetRootModuleName :: !Project -> String
PR_GetRootPathName :: !Project -> (String,Project)
PR_GetRootPath :: !Project -> String
PR_GetRootPathName :: !Project -> (!String,!Project)
PR_GetRootModuleDir :: !Project -> String
PR_GetModulenames :: !Bool !Def_and_Imp !Project -> (List String,Project)
PR_GetOpenModulenames :: !Project -> List String
PR_GetModuleStuff :: !Project -> List (Modulename,String,Modulename,String)
......
......@@ -9,8 +9,6 @@ import PmTypes
import Platform
import UtilOptions, PmFiles
//--
:: Def_and_Imp :== Bool;
DclMod :== True;
IclMod :== False;
......@@ -68,7 +66,6 @@ PR_InitProject =
, codegenopt = DefCodeGenOptions
, code_gen_options_unchanged = True
, applicationopt = DefApplicationOptions
// , projectopt = DefProjectOptions
, linkOptions = DefaultLinkOptions
, prjpaths = Nil
, staticLibInfo = DefStaticLibInfo
......@@ -96,8 +93,10 @@ PR_ProjectSet project=:{inflist} = True;
PR_NewProject :: !String !EditWdOptions !CompilerOptions !CodeGenOptions !ApplicationOptions
!(List String) !LinkOptions -> Project;
PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptions =
{ PR_InitProject
PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptions
# modname = GetModuleName main_module_file_name;
dirname = RemoveFilename main_module_file_name;
= { PR_InitProject
& built = False
, saved = False
, exec = False
......@@ -125,14 +124,10 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
, staticLibInfo = DefStaticLibInfo
, target = "StdEnv"
}
where
modname = GetModuleName main_module_file_name;
dirname = RemoveFilename main_module_file_name;
//--
PR_SetBuilt :: !(List Modulename) !.Project -> .Project;
PR_SetBuilt used project=:{inflist=Nil} = {Project | project & built = True};
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
......@@ -145,15 +140,11 @@ where
RemoveUnusedModules used list = FilterR member list
where
member {mn} = StringOccurs 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}
// # project = trace_n ("PR_Add: no root...") project
= project
PR_AddABCInfo mod_path dep_objects dep_libraries compilerOptions defeo impeo project=:{inflist}
// # project = trace_n ("PR_Add: adding "+++mod_path) project
# inflist = TryInsertInList mod_name mod_dir inflist
# (inflist,_) = UpdateList mod_name update inflist;
= {project & saved=False,inflist=inflist, built=False}
......@@ -199,8 +190,6 @@ where
= TryInsertImporter rest list
= list
//--
PR_ClearDependencies :: !Project -> Project
PR_ClearDependencies project=:{inflist=Nil}
= {project & saved = False, inflist = Nil, built = False}
......@@ -232,7 +221,6 @@ PR_SetRoot newroot eo compilerOptions project=:{prjpaths}
where
modname = GetModuleName newroot;
dirname = RemoveFilename newroot;
PR_SetCompiled :: !Modulename !Project -> Project;
PR_SetCompiled modname project=:{inflist}
......@@ -368,24 +356,24 @@ PR_SetPaths def defs new project=:{Project | built,inflist=infl=:((root=:{InfLis
PR_GetCodeGenOptions :: !Project -> CodeGenOptions;
PR_GetCodeGenOptions project=:{codegenopt} = codegenopt;
PR_GetCodeGenOptions {codegenopt} = codegenopt;
//PR_GetProcessor :: !Project -> Processor;
//PR_GetProcessor project=:{codegenopt={tp}} = tp;
PR_GetApplicationOptions :: !Project -> ApplicationOptions;
PR_GetApplicationOptions project=:{applicationopt} = applicationopt;
PR_GetApplicationOptions {applicationopt} = applicationopt;
PR_GetPaths :: !Project -> List String;
PR_GetPaths project=:{Project | prjpaths} = prjpaths;
PR_GetPaths {Project | prjpaths} = prjpaths;
PR_GetRootModuleName :: !Project -> String
PR_GetRootModuleName p=:{inflist=Nil}
PR_GetRootModuleName {inflist=Nil}
= EmptyPathname
PR_GetRootModuleName p=:{inflist={mn}:!rest}
PR_GetRootModuleName {inflist={mn}:!rest}
= mn
PR_GetRootPathName :: !Project -> (String,Project)
PR_GetRootPathName :: !Project -> (!String,!Project)
PR_GetRootPathName p=:{inflist=Nil}
= (EmptyPathname,p)
PR_GetRootPathName p=:{inflist={mn,info={dir}}:!rest}
......@@ -393,10 +381,10 @@ PR_GetRootPathName p=:{inflist={mn,info={dir}}:!rest}
= (EmptyPathname,p)
= (MakeFullPathname dir (MakeImpPathname mn),p)
PR_GetRootPath :: !Project -> String
PR_GetRootPath {inflist=Nil}
PR_GetRootModuleDir :: !Project -> String
PR_GetRootModuleDir {inflist=Nil}
= EmptyPathname;
PR_GetRootPath {inflist={mn,info={dir}}:!rest}
PR_GetRootModuleDir {inflist={mn,info={dir}}:!rest}
| size dir==0
= EmptyPathname;
= dir;
......@@ -449,8 +437,7 @@ PR_SrcUpToDate modname project=:{inflist}
= False
# item = fromJust item
= item.src
PR_ABCUpToDate :: !Modulename !Project -> Bool;
PR_ABCUpToDate modname project=:{inflist}
# item = FindInList modname inflist
......@@ -458,8 +445,7 @@ PR_ABCUpToDate modname project=:{inflist}
= False
# item = fromJust item
= item.abc
PR_SysUptoDate :: !Project -> Bool;
PR_SysUptoDate project=:{code_gen_options_unchanged} = code_gen_options_unchanged;
......@@ -474,9 +460,9 @@ PR_AddRootModule :: !Bool !CodeGenOptions !ApplicationOptions !(List String) !Li
PR_AddRootModule built cg ao prjs linkOptions mn info=:{dir}
= { PR_InitProject
& built = built && dir <> ""
, saved = False // ???
, saved = False
, exec = True
, execpath = ""//MakeExecPathname (MakeFullPathname dir mn)
, execpath = ""
, code_gen_options_unchanged
= True
, inflist = root:!Nil
......@@ -489,8 +475,7 @@ PR_AddRootModule built cg ao prjs linkOptions mn info=:{dir}
};
where
root = { mn = mn,info = info,src = True,abc = True };
PR_AddModule :: !Modulename !ModInfo !Project -> Project;
PR_AddModule mn info=:{dir} project=:{built,inflist=root:!rest}
= {project & built = built && dir<>"", inflist = root:!new:!rest};
......@@ -630,8 +615,8 @@ GetProject applicationDir projectDir project
where
exepath
# xp = PR_GetExecPath project
# xp = symPath applicationDir projectDir xp
= xp
= symPath applicationDir projectDir xp
mainModuleInfo = getModule mainModuleName
mainModuleName = PR_GetRootModuleName project
(otherModuleNames,project`) = PR_GetModulenames False IclMod project
......@@ -670,8 +655,6 @@ where
}
*/
//--
ExpandModuleInfoPaths :: {#Char} {#Char} ModInfo -> ModInfo
ExpandModuleInfoPaths applicationDir projectDir moduleInfo=:{dir}
= {moduleInfo & dir = ExpandPath applicationDir projectDir dir}
......@@ -720,8 +703,6 @@ SubstitutePaths applicationDir projectDir list
SubstitutePath applicationDir projectDir path
:== symPath applicationDir projectDir path
//---
PR_GetABCLinkInfo :: !Project -> ABCLinkInfo;
PR_GetABCLinkInfo project=:{inflist}
# allLinkInfoRecords = map (\{InfListItem | info={abcLinkInfo}} -> abcLinkInfo) (StrictListToList inflist);
......@@ -735,8 +716,6 @@ where
emptyRecord
= { linkObjFileNames = Nil, linkLibraryNames = Nil};
//---
PR_GetStaticLibsInfo :: !Project -> StaticLibInfo
PR_GetStaticLibsInfo {Project | staticLibInfo} = staticLibInfo
......@@ -753,8 +732,6 @@ PR_SetTarget target project
= project
= {Project | project & target = target, exec = False, saved = False}
//--
SL_Add :: !String !StaticLibInfo -> StaticLibInfo
SL_Add pathname sl
// load sDcls and sDeps info...
......@@ -787,8 +764,6 @@ SL_SetDcls lp sl = {sl & sDcls = lp}
SL_SetDeps :: !(List String) !StaticLibInfo -> StaticLibInfo
SL_SetDeps lp sl = {sl & sDeps = lp}
//--
SaveProjectFile :: !String !Project !String !*Files -> (!Bool, !*Files);
SaveProjectFile projectPath project applicationDir files
#! (opened, file, files) = fopen projectPath FWriteText files
......@@ -819,9 +794,6 @@ ReadProjectFile projectPath applicationDir ps
(\p->{p&pg_target="StdEnv"})
(id)
) projectGO // DvA: need to set needs save flag for project;
/*
It's better to replace above with a dialog with popup of available environments.
*/
unexpanded_exec_path = projectGO.pg_execpath
project = SetProject applicationDir projectDir projectGO
execpath = PR_GetExecPath project
......
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