rascal
rascal copied to clipboard
public interface for module loading
- [x] hide the generated public constructors with a @deprecated "for internal use only" tag (because the contract with the $ModuleStore can be violated with manual usage of these constructors)
- [x] remove unused fields pcfg and rascalSearchPath from the RascalExecutionContext
- [x] generate a safe
static$loadmethod into all classes and interfaces to replace the old usage of constructors (completely and safely hides the moduleStore below the hood). - [x] make certain internal methods of RascalExecutionContext @Deprecated "for internal use only"
For example:
$ParserGenerator.$load(rex)will return a$ParserGenerator_$Iimplementation.- Also
$ParserGenerator_$I.$load(rex)does the same for convenience' sake. - repeated calls to
$loadwill return the previously loaded module $loadon a previously imported module from the samerexwill return the module loaded earlier via the import mechamism:$List.load(rex)- A new
rexmeans new object instances which are initialized from scratch. - Calling
$loadfor different modules in the same import/extend hierarchy in different orders has no influence on the resulting module references. This is due to how the ModuleStore works. With one exception: the values of globals may be influenced in the presence of side-effects.