]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/scl/SCL/ModuleRepository.scl
Added a function to read the module source text
[simantics/platform.git] / bundles / org.simantics.scl.compiler / scl / SCL / ModuleRepository.scl
index 7d035d8cf6e380c66e3a16d228a237e34ecd2c7b..e8d37789b00be77a32ef8cc6306fd6ab8fa6cb16 100644 (file)
@@ -1,6 +1,6 @@
 module {
     export = [possibleUnsafeSclValueByName, unsafeSclValueByName, sclModuleNames, moduleByName,
-              documentationOfSCLValue, sclValueRef]
+              documentationOfSCLValue, sclValueRef, possibleModuleSourceText]
 }
 
 include "./CurrentModuleRepository"
@@ -35,6 +35,9 @@ importJava "org.simantics.scl.compiler.source.repository.ModuleSourceRepository"
     
     @JavaName getModuleNames
     sclModuleNames_ :: ModuleSourceRepository -> [String]
+    
+    @JavaName getPossibleSourceText
+    possibleModuleSourceText_ :: ModuleSourceRepository -> String -> <Proc> Maybe String
 
 importJava "org.simantics.scl.compiler.errors.Failable" where
     data Failable a
@@ -56,4 +59,7 @@ sclModuleNames = sclModuleNames_ (moduleSourceRepositoryOf MODULE_REPOSITORY)
 moduleByName :: String -> <Proc> Maybe Module
 moduleByName name = getResult failable
   where
-    failable = moduleByName_ MODULE_REPOSITORY name
\ No newline at end of file
+    failable = moduleByName_ MODULE_REPOSITORY name
+    
+possibleModuleSourceText :: String -> <Proc> Maybe String
+possibleModuleSourceText name = possibleModuleSourceText_ (moduleSourceRepositoryOf MODULE_REPOSITORY) name
\ No newline at end of file