language-python-0.5.2: Parsing and pretty printing of Python code.

Copyright(c) 2009 Bernie Pope
LicenseBSD-style
Maintainerbjpop@csse.unimelb.edu.au
Stabilityexperimental
Portabilityghc
Safe HaskellSafe
LanguageHaskell98

Language.Python.Common.ParserMonad

Description

Monad support for Python parser and lexer.

Documentation

thenP :: P a -> (a -> P b) -> P b

returnP :: a -> P a

setInput :: String -> P ()

data ParseError

Constructors

UnexpectedToken Token

An error from the parser. Token found where it should not be. Note: tokens contain their own source span.

UnexpectedChar Char SrcLocation

An error from the lexer. Character found where it should not be.

StrError String

A generic error containing a string message. No source location.

pushIndent :: Int -> P ()

popIndent :: P ()

pushParen :: Token -> P ()

popParen :: P ()

addComment :: Token -> P ()

spanError :: Span a => a -> String -> P b