From: Alpi Rimppi Date: Wed, 21 Aug 2019 07:50:07 +0000 (+0300) Subject: Imported ModuleRepository.flush from Java X-Git-Tag: v1.43.0~136^2~107^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F3132%2F2;p=simantics%2Fplatform.git Imported ModuleRepository.flush from Java Change-Id: Ib0d147925995508c21d4acee7c4355feabd10f1f --- diff --git a/bundles/org.simantics.scl.compiler/scl/SCL/ModuleRepository.scl b/bundles/org.simantics.scl.compiler/scl/SCL/ModuleRepository.scl index e8d37789b..3925450bd 100644 --- a/bundles/org.simantics.scl.compiler/scl/SCL/ModuleRepository.scl +++ b/bundles/org.simantics.scl.compiler/scl/SCL/ModuleRepository.scl @@ -1,6 +1,7 @@ module { export = [possibleUnsafeSclValueByName, unsafeSclValueByName, sclModuleNames, moduleByName, - documentationOfSCLValue, sclValueRef, possibleModuleSourceText] + documentationOfSCLValue, sclValueRef, possibleModuleSourceText, flushModuleRepository, + flushDefaultModuleRepository] } include "./CurrentModuleRepository" @@ -30,6 +31,9 @@ importJava "org.simantics.scl.compiler.module.repository.ModuleRepository" where @JavaName getModule moduleByName_ :: ModuleRepository -> String -> Failable Module + @JavaName flush + flushModuleRepository :: ModuleRepository -> () + importJava "org.simantics.scl.compiler.source.repository.ModuleSourceRepository" where data ModuleSourceRepository @@ -50,6 +54,9 @@ unsafeSclValueByName = unsafeSclValueByName_ MODULE_REPOSITORY sclValueRef name = sclValueRef_ MODULE_REPOSITORY name +flushDefaultModuleRepository :: () +flushDefaultModuleRepository = flushModuleRepository MODULE_REPOSITORY + possibleUnsafeSclValueByName :: String -> Maybe a possibleUnsafeSclValueByName name = Just (unsafeSclValueByName name) `catch` \(_ :: Exception) -> Nothing