Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-ide
Commits
23e66381
Commit
23e66381
authored
Oct 02, 2012
by
John van Groningen
Browse files
use type ModuleDirAndName instead of type String
parent
6868ed0a
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Pm/PmDriver.icl
View file @
23e66381
This diff is collapsed.
Click to expand it.
Pm/PmFileInfo.dcl
View file @
23e66381
...
...
@@ -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
!
Pathn
ame
!
ABCCache
!
FileInfoCache
!*
env
->
((!
ABCCache
,!
FileInfoCache
,
!
FileInfo
),!*
env
)
|
FileEnv
env
FI_UpdateAbcDate
::
!
Path
name
!
Pathname
!
Bool
!
FileInfoCache
!*
Files
->
((!
DATE
,!
FileInfoCache
),
!*
Files
)
FI_UpdateABCInfo
::
!
Path
name
!
Pathname
!
ABCCache
!
FileInfoCache
!*
Files
->
((!
DATE
,!
ABCCache
,!
FileInfoCache
),
!*
Files
)
FI_UpdateObjDate
::
!
Path
name
!
Pathname
!
FileInfoCache
!*
Files
->
(!
FileInfoCache
,
!*
Files
)
FI_UpdateFileInfo
::
!
Path
name
!(
FileInfo
->
FileInfo
)
!
FileInfoCache
->
FileInfoCache
FI_GetFileInfo
::
!
Processor
!
ModuleDirAndN
ame
!
ABCCache
!
FileInfoCache
!*
env
->
((!
ABCCache
,!
FileInfoCache
,
!
FileInfo
),!*
env
)
|
FileEnv
env
FI_UpdateAbcDate
::
!
Module
name
!
Pathname
!
Bool
!
FileInfoCache
!*
Files
->
((!
DATE
,!
FileInfoCache
),
!*
Files
)
FI_UpdateABCInfo
::
!
Module
name
!
Pathname
!
ABCCache
!
FileInfoCache
!*
Files
->
((!
DATE
,!
ABCCache
,!
FileInfoCache
),
!*
Files
)
FI_UpdateObjDate
::
!
Module
name
!
Pathname
!
FileInfoCache
!*
Files
->
(!
FileInfoCache
,
!*
Files
)
FI_UpdateFileInfo
::
!
Module
name
!(
FileInfo
->
FileInfo
)
!
FileInfoCache
->
FileInfoCache
FI_GetCleanModules
::
!
Pathname
!
StaticLibInfo
!
FileInfoCache
->
(!
List
Pathname
,
!
FileInfoCache
)
YoungestObj
::
!
DATE
!
FileInfoCache
->
DATE
Pm/PmFileInfo.icl
View file @
23e66381
...
...
@@ -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
!
Pathn
ame
!
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
!
ModuleDirAndN
ame
!
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
!
Pathn
ame
!
ABCCache
!
FileInfoCache
!
FileInfoCache
!
Files
GetFileInfo1
::
!
Processor
!
ModuleDirAndN
ame
!
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
::
!
Path
name
!(
FileInfo
->
FileInfo
)
!
FileInfoCache
->
FileInfoCache
FI_UpdateFileInfo
key
update
list
=
UpdateFileInfo1
key
update
list
Nil
FI_UpdateFileInfo
::
!
Module
name
!(
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
)
...
...
Pm/PmPath.dcl
View file @
23e66381
...
...
@@ -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"
;
...
...
Pm/PmPath.icl
View file @
23e66381
...
...
@@ -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
...
...
Pm/PmProject.dcl
View file @
23e66381
...
...
@@ -52,7 +52,7 @@ PR_ProjectSet :: !Project -> Bool
PR_NewProject
::
!
String
!
EditWdOptions
!
CompilerOptions
!
CodeGenOptions
!
ApplicationOptions
!(
List
String
)
!
LinkOptions
->
Project
PR_SetBuilt
::
!
(
List
Modulen
ame
)
!.
Project
->
.
Project
PR_SetBuilt
::
!
[!
ModuleDirAndN
ame
]
!.
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
...
...
Pm/PmProject.icl
View file @
23e66381
...
...
@@ -128,12 +128,11 @@ PR_NewProject main_module_file_name eo compilerOptions cgo ao prjpaths linkOptio
,
root_directory
=
dirname
}
PR_SetBuilt
::
!
(
List
Modulen
ame
)
!.
Project
->
.
Project
;
PR_SetBuilt
::
!
[!
ModuleDirAndN
ame
]
!.
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
}
=
StringO
ccurs
mn
used
&&
rootmn
<>
mn
member
{
mn
}
=
module_o
ccurs
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
...
...
Pm/PmTypes.dcl
View file @
23e66381
...
...
@@ -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
]
...
...
Win/PmCleanSystem.dcl
View file @
23e66381
...
...
@@ -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
)
!
Pathn
ame
CompileHandleExitCode
::
!
Int
!
String
!
String
!
Int
!(
WindowFun
*
env
)
!(
WindowFun
*
env
)
!
ModuleDirAndN
ame
!
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
...
...
Win/PmCleanSystem.icl
View file @
23e66381
...
...
@@ -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
)
!
Pathn
ame
CompileHandleExitCode
::
!
Int
!
String
!
String
!
Int
!(
WindowFun
*
env
)
!(
WindowFun
*
env
)
!
ModuleDirAndN
ame
!
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
=
M
ake
ABCSystemPathname
path
#
abcpath
=
M
oduleDirAndNameTo
ABCSystemPathname
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment