From b13606b0ca949dbb80c63fec6a7da74201b0af2d Mon Sep 17 00:00:00 2001 From: Alpi Rimppi Date: Wed, 21 Aug 2019 10:50:07 +0300 Subject: [PATCH] Imported ModuleRepository.flush from Java Change-Id: Ib0d147925995508c21d4acee7c4355feabd10f1f --- .../scl/SCL/ModuleRepository.scl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.47.1