definition module iTasks.Gin.Parser //import StdList //import GenPrint //import JSON //import Monad import iTasks.Gin.Config import iTasks.Gin.Syntax import iTasks.Gin.AbstractSyntax from iTasks import class iTask :: GPath :== [GPathNode] :: GPathNode = NodePath GResourceId | ParamPath String | EdgePath GResourceId :: GParseResult a = GSuccess a | GError [(GPath, String)] :: GParseState a = GParseState (GPath -> GParseResult a) derive class iTask GPathNode, GParseResult, GParseState isParseError :: (GParseResult a) -> Bool getParseSuccess :: (GParseResult a) -> a getParseError :: (GParseResult a) -> [(GPath, String)] instance Monad GParseState class PathNode a where getPathNode :: a GPath -> GPath instance PathNode GNode instance PathNode GEdge instance PathNode (String,GExpression) parseChild :: a (GParseState b) -> GParseState b | PathNode a parseMap :: (a -> GParseState b) [a] -> GParseState [b] parseChildMap :: (a -> GParseState b) [a] -> GParseState [b] | PathNode a orElse :: (GParseState a) (GParseState a) -> GParseState a parseError :: String -> GParseState a parseErrorInChild :: a String -> GParseState b | PathNode a parseErrorInChildren :: [a] String -> GParseState b | PathNode a getCurrentPath :: GParseState GPath //withPath :: GPath (GParseState a) -> GParseState a runParse :: (GParseState a) -> GParseResult a gToAModule :: !GModule !GinConfig !*World -> (GParseState AModule, *World) //Utils foldl1 :: (a a -> a) [a] -> a