Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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, ELambda, 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, Type) -> SuccFail Value
- parseTypedInputs2 :: [String] -> [Type] -> SuccFail [Value]
- parseTypedInput3 :: (String, String, Type) -> SuccFail Value
- parseTypedInputs3 :: [String] -> [String] -> [Type] -> SuccFail [Value]
- nothingBut :: Parser a -> Parser a
- expr :: Parser Expr
- list :: Parser a -> Parser [a]
- value :: Parser Value
- typedValue :: Type -> Parser Value
- bool :: Parser Bool
- qchar :: Parser Char
- qstring :: Parser String
- integer :: Parser Integer
- double :: Parser Double
- number :: Parser Number
Documentation
parseExpr :: String -> SuccFail Expr Source
Parse a Sifflet data literal (number, string, char, bool, or list), returning an Expr
parseValue :: String -> SuccFail Value Source
Parse a Sifflet literal expression and return its Value
parseLiteral :: String -> SuccFail Expr Source
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 a Source
parseTypedInput2 :: (String, Type) -> SuccFail Value Source
Try to parse an input value of a specific type
Try to parse input values of specific types
parseTypedInput3 :: (String, String, Type) -> SuccFail Value Source
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 a Source
'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.
typedValue :: Type -> Parser Value Source
Parser for a value with a specific primitive or concrete list type expected.