Safe Haskell | Safe-Infered |
---|
A parser for Sifflet input values. This is not a parser for all Sifflet expressions, but just those that might be input in textual form through the function call dialog that asks for the argument values. So, it is limited (deliberately) to data types of expressions: that is, Exprs using the constructors: ELit EList That means excluding Exprs constructed with EUndefined, ESymbol, EIf, and ECall.
- parseExpr :: String -> SuccFail Expr
- parseValue :: String -> SuccFail Value
- parseLiteral :: String -> SuccFail Expr
- parseTest :: (Stream s Identity t, Show a) => Parsec s () a -> s -> IO ()
- parseSuccFail :: Parser a -> String -> SuccFail a
- parseTypedInput2 :: (String, VpType) -> SuccFail Value
- parseTypedInputs2 :: [String] -> [VpType] -> SuccFail [Value]
- parseTypedInput3 :: (String, String, VpType) -> SuccFail Value
- parseTypedInputs3 :: [String] -> [String] -> [VpType] -> SuccFail [Value]
- nothingBut :: Parser a -> Parser a
- expr :: Parser Expr
- list :: Parser a -> Parser [a]
- value :: Parser Value
- typedValue :: VpType -> Parser Value
- bool :: Parser Bool
- qchar :: Parser Char
- qstring :: Parser String
- integer :: Parser Integer
- double :: Parser Double
- number :: Parser Number
Documentation
parseExpr :: String -> SuccFail ExprSource
Parse a Sifflet data literal (number, string, char, bool, or list), returning an Expr
parseValue :: String -> SuccFail ValueSource
Parse a Sifflet literal expression and return its Value
parseLiteral :: String -> SuccFail ExprSource
parseTest :: (Stream s Identity t, Show a) => Parsec s () a -> s -> IO ()
The expression parseTest p input
applies a parser p
against
input input
and prints the result to stdout. Used for testing
parsers.
parseSuccFail :: Parser a -> String -> SuccFail aSource
parseTypedInput2 :: (String, VpType) -> SuccFail ValueSource
Try to parse an input value of a specific type
Try to parse input values of specific types
parseTypedInput3 :: (String, String, VpType) -> SuccFail ValueSource
Try to parse an input value for a named variable of a specific type
Try to parse input values for named variables of specific types
nothingBut :: Parser a -> Parser aSource
'nothingBut p is like p
, but consumes the entire input,
so there must be no extraneous characters (except space)
after whatever p
parses.
Parse a Sifflet data expression -- actually only a literal or a list of literals.
Parser for a Value of any type (any VpType), except that we cannot parse as VpTypeVar or VpTypeFunction.
typedValue :: VpType -> Parser ValueSource
Parser for a value with a specific VpType expected. Again, we cannot do this for VpTypeVar (why not?) or VpTypeFunction