Commit d48e55c9 authored by Jurrien Stutterheim's avatar Jurrien Stutterheim

CPM: Export more functions

parent 3fac4b90
module Cpm
/**
* CPM imports
*/
import AbsSyn, CpmLogic, Parser
/**
* CleanIDE imports
*/
import UtilIO
/**
* Clean Platform imports
*/
import CommandLine, Environment, Func, List, Text
/**
* Clean libraries imports
*/
import StdFile, StdString
/**
* CPM: Clean Project Management
*
......@@ -61,6 +39,28 @@ import StdFile, StdString
* - Make sure `EnvironmentVersion` has value `920`
*/
module Cpm
/**
* CPM imports
*/
import AbsSyn, CpmLogic, Parser
/**
* CleanIDE imports
*/
import UtilIO
/**
* Clean Platform imports
*/
import CommandLine, Environment, Func, List, Text
/**
* Clean libraries imports
*/
import StdFile, StdString
/**
* Start function which reads the program arguments, starts the parser and
* starts processing the parse results.
......@@ -74,4 +74,3 @@ Start world
(_, world) -> (pwd, world)
= doCpmAction ch pwd (startParse (fromString $ mkCl cmd)) world
where mkCl cmd = concat (intersperse " " (tl [fromString arg \\ arg <- cmd]))
definition module CpmLogic
from AbsSyn import :: CpmAction
/**
* CPM imports
*/
import AbsSyn
/**
* CleanIDE imports
*/
from PmProject import :: Project
/**
* Execute a general CPM action
*/
doCpmAction :: String String .CpmAction *World -> .World
/**
* Execute project-specific actions
*/
doProjectAction :: .String .String .String .ProjectAction *World -> .World
/**
* Execute path-related project actions
*/
doProjectPathAction :: .String .String Project .PathAction *World -> .World
/**
* Execute module-related actions
*/
doModuleAction :: .String .String .ModuleAction *World -> .World
/**
* Modify a project
*/
withProject :: String String .(Project -> Project) *World -> .World
/**
* Collect all project paths in a list with an index prefixed
*/
showPaths :: Project -> .[String]
/**
* Modify the list of paths in a project given a modification function which
* takes a strict list of project paths and returns a strict list of project
* paths.
*/
doModPaths :: String String Project .([!String!] -> [!String!]) *World -> .World
/**
* Open a project file
*/
openProject :: !FilePath !FilePath !*World -> (!Project, !*World)
/**
* Save a project back to its project file
*/
saveProject :: !FilePath !Project !FilePath !*World -> *World
/**
* Remove an item from a strict list at a given index. Abort execution if the
* index is out of bounds.
*/
rmStrictListIdx :: Int u:[!.a!] -> v:[!.a!], [u <= v]
/**
* Move a path at a given index up or down the list of paths. Abort execution
* if the index is out of bounds.
*/
moveStrictListIdx :: .Int .PathDirection .[!a!] -> .[!a!]
/**
* Show an error message
*/
error :: String *World -> .World
/**
* Show a help message
*/
help :: !String ![String] !*World -> *World
/**
* Given a list of strings, concatenate them to a single string with newlines
* in between, then print that new string to console.
*/
showLines :: ![String] !*World -> *World
definition module Parser
from AbsSyn import :: CpmAction
/**
* CPM imports
*/
import AbsSyn
/**
* Clean Platform imports
*/
from ParserCombinators import :: Parser, :: CParser, :: ParsResult, :: AltCont, :: XorCont, :: SucCont
/**
* Parse the a list of characters to get the action to be executed. If parsing
* fails, CpmHelp is returned as default action so help may be displayed.
*/
startParse :: [.Char] -> CpmAction
/**
* Parse one or more non-whitespace characters
*/
pNotSpace :: CParser Char [Char] a
/**
* Wrapper around the token parser that converts a Clean string to a list of
* charactersm for easier parsing
*/
spstrtok :: (String -> CParser Char [Char] a)
/**
* Top-level parser for CPM commands
*/
pCpm :: CParser Char CpmAction a
/**
* Parser for the project commands
*/
pProject :: CParser Char CpmAction a
/**
* Parser for all path-related actions
*/
pPathAction :: CParser Char ProjectAction a
/**
* Parser for constant mappings between text and constructors
*/
pConstCtr :: [(String, c)] -> CParser Char c a
/**
* Parser to toggle the --force flag
*/
pForce :: CParser Char Bool a
/**
* Parser for the argument to specify where the IDEEnvs file is
*/
pIDEEnvs :: CParser Char String a
/**
* Parser for module-related actions
*/
pModule :: CParser Char CpmAction a
/**
* Parser for the help command
*/
pHelp :: c -> CParser Char c a
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment