Package org.openquark.cal.services

Examples of org.openquark.cal.services.StringModuleSourceDefinition


     */
    private void testWithModuleCALDocComment(String comment, Class<? extends MessageKind.Error> errorClass) {
        ModuleName tempModuleName = CompilerTestUtilities.getNewModuleName(leccCALServices);
        String sourceDefString = comment + " module " + tempModuleName + "; import " + CAL_Prelude.MODULE_NAME + ";";
       
        ModuleSourceDefinition sourceDef = new StringModuleSourceDefinition(tempModuleName, sourceDefString);
       
        // Get the workspace manager and the logger.
        WorkspaceManager workspaceManager = leccCALServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
       
View Full Code Here


                    if (renaming.category == SourceIdentifier.Category.MODULE_NAME && recompiledModuleName.equals(ModuleName.make(renaming.oldName))) {
                        recompiledModuleName = ModuleName.make(renaming.newName);
                    }
                }
               
                sourceDef = new StringModuleSourceDefinition(recompiledModuleName, moduleString);
               
                // Remove the old module from the workspace and add the new one. This will also force a recompilation of the relevant modules.
                CompilerMessageLogger logger = new MessageLogger();
                privateCopyLeccServices.getWorkspaceManager().removeModule(moduleName, new Status(""));    
                privateCopyLeccServices.getWorkspaceManager().makeModule(sourceDef, logger);
View Full Code Here

            "import " + Prelude + ";" +
           
            "data Foo = Foo " + Prelude + ".Int;";

        // Compile the module.
        ModuleSourceDefinition moduleSourceDef = new StringModuleSourceDefinition(moduleName, moduleCode);
        workspaceManager.makeModule(moduleSourceDef, logger);

        // Remove the module.
        leccCALServices.getWorkspaceManager().removeModule(DEFAULT_TEST_MODULE_NAME, new Status("Remove module status."));
       
View Full Code Here

    private static CompilerMessageLogger compileAndRemoveModule(ModuleName moduleName, String outerDefnText, BasicCALServices calServices) {
        String sourceDefString = "module " + moduleName + ";\n";
        sourceDefString += "import " + CAL_Prelude.MODULE_NAME + ";\n";
        sourceDefString += outerDefnText;
       
        ModuleSourceDefinition sourceDef = new StringModuleSourceDefinition(moduleName, sourceDefString);
       
        // Get the workspace manager and the logger.
        WorkspaceManager workspaceManager = calServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.StringModuleSourceDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.