X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.scl.compiler%2Fscl%2FSCL%2FReflection.scl;h=3e8aeb97be5f2dda3e33ffabd349d6838e5f89dd;hb=7444d4b3a2f3c25fac462d8a168898656dafd52e;hp=e32401d502c79aada0291d3c510b91a28b0ffc14;hpb=f238db98a6075e59973c5c391a1946eb7972c7a5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/scl/SCL/Reflection.scl b/bundles/org.simantics.scl.compiler/scl/SCL/Reflection.scl index e32401d50..3e8aeb97b 100644 --- a/bundles/org.simantics.scl.compiler/scl/SCL/Reflection.scl +++ b/bundles/org.simantics.scl.compiler/scl/SCL/Reflection.scl @@ -1,69 +1,5 @@ module { - export = [possibleUnsafeSclValueByName, unsafeSclValueByName, sclModuleNames, moduleByName, - moduleOf, nameOf, createName, valueNamesOf] + deprecated = "Use more specialized modules like ModuleRepository" } -include "SCL/ReflectionJava" - -importJava "org.simantics.scl.compiler.module.repository.ModuleRepository" where - @JavaName getValue - unsafeSclValueByName_ :: ModuleRepository -> String -> a - - @JavaName getSourceRepository - moduleSourceRepositoryOf :: ModuleRepository -> ModuleSourceRepository - - @JavaName getModule - moduleByName_ :: ModuleRepository -> String -> Failable Module - -importJava "org.simantics.scl.compiler.source.repository.ModuleSourceRepository" where - data ModuleSourceRepository - - @JavaName getModuleNames - sclModuleNames_ :: ModuleSourceRepository -> [String] - -importJava "org.simantics.scl.compiler.errors.Failable" where - data Failable a - - didSucceed :: Failable a -> Boolean - getResult :: Failable a -> Maybe a - -importJava "org.simantics.scl.compiler.module.Module" where - data Module - - @JavaName getValueNames - valueNamesOf_ :: Module -> [String] - -importJava "org.simantics.scl.compiler.common.names.Name" where - data Name - - @JavaName module - moduleOf_ :: Name -> String - @JavaName name - nameOf_ :: Name -> String - - @JavaName create - createName_ :: String -> String -> Name - -instance Show Name where - sb <+ n = sb << moduleOf n << "/" << nameOf n - -moduleOf = moduleOf_ -nameOf = nameOf_ -createName = createName_ -valueNamesOf = valueNamesOf_ - -type Location = Long - -unsafeSclValueByName :: String -> a -unsafeSclValueByName = unsafeSclValueByName_ MODULE_REPOSITORY - -possibleUnsafeSclValueByName :: String -> Maybe a -possibleUnsafeSclValueByName name = Just (unsafeSclValueByName name) `catch` \(_ :: Exception) -> Nothing - -sclModuleNames :: [String] -sclModuleNames = sclModuleNames_ (moduleSourceRepositoryOf MODULE_REPOSITORY) - -moduleByName :: String -> Maybe Module -moduleByName name = getResult failable - where - failable = moduleByName_ MODULE_REPOSITORY name \ No newline at end of file +include "./ModuleRepository" \ No newline at end of file