Commit c1af8608 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur

removed useless version check for coclmain (coclmain is not in a separate libarary)

parent eccbe14b
......@@ -16,25 +16,7 @@ definition module coclmain
uses
StdEnv
compiler
This library is compiled with profiling code. This means that profiling
should also be enabled in projects that use the coclmain library.
Note: The interface from coclmain to the compiler is not version checked.
It's safest to build and use a new coclmain library whenever the
type of the compiler's syntax tree changes.
*/
// coclMain :: ![{#Char}] !*World -> *World
coclMain :: ![{#Char}] !*World -> *World
// testArgs world
coclMain :== coclMainWithVersionCheck CoclMainVersionCurrent CoclMainVersionLatestDef CoclMainVersionLatestImp
CoclMainVersionCurrent
:== 0x02000205
CoclMainVersionLatestDef
:== 0x02000205
CoclMainVersionLatestImp
:== 0x02000205
coclMainWithVersionCheck :: !Int !Int !Int ![{#Char}] !*World -> *World
// currentVersion latestDefVersion latestImpVersion testArgs world
......@@ -3,59 +3,15 @@
*/
implementation module coclmain
CoclMainVersion :== 0
import StdEnv
import ArgEnv
import Version
import set_return_code
import compile
// coclMain :: ![{#Char}] !*World -> *World
// testArgs world
coclMain :== coclMainWithVersionCheck CoclMainVersionCurrent CoclMainVersionLatestDef CoclMainVersionLatestImp
CoclMainVersionCurrent
:== 0x02000205
CoclMainVersionLatestDef
:== 0x02000205
CoclMainVersionLatestImp
:== 0x02000205
checkVersion :: VersionsCompatability *File -> (!Bool, !*File)
checkVersion VersionsAreCompatible errorFile
= (True, errorFile)
checkVersion VersionObservedIsTooNew errorFile
# errorFile
= fwrites "[Coclmain] the library is too new\n" errorFile
= (False, errorFile)
checkVersion VersionObservedIsTooOld errorFile
# errorFile
= fwrites "[Coclmain] the library is too old\n" errorFile
= (False, errorFile)
coclMainWithVersionCheck :: !Int !Int !Int ![{#Char}] !*World -> *World
coclMain :: ![{#Char}] !*World -> *World
// currentVersion latestDefVersion latestImpVersion testArgs world
coclMainWithVersionCheck currentVersion latestDefVersion latestImpVersion testArgs world
# observedVersion =
{ versionCurrent
= CoclMainVersionCurrent
, versionOldestDefinition
= CoclMainVersionLatestDef
, versionOldestImplementation
= CoclMainVersionLatestImp
}
expectedVersion =
{ versionCurrent
= currentVersion
, versionOldestDefinition
= latestDefVersion
, versionOldestImplementation
= latestImpVersion
}
| not (fst (checkVersion (versionCompare expectedVersion observedVersion) stderr))
= set_return_code (-1) world
coclMain testArgs world
# (commandArgs, world)
= getCommandArgs (tl [arg \\ arg <-: getCommandLine]) testArgs world
# (success, world)
......
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