Copyright | (C) CSIRO 2017-2018 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- module Language.Python.Parse.Error
- type Parser = Parsec Void PyTokens
- parseModule :: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) => FilePath -> Text -> Validation (NonEmpty e) (Module '[] SrcInfo)
- parseStatement :: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) => FilePath -> Text -> Validation (NonEmpty e) (Statement '[] SrcInfo)
- parseExpr :: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) => FilePath -> Text -> Validation (NonEmpty e) (Expr '[] SrcInfo)
- parseExprList :: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) => FilePath -> Text -> Validation (NonEmpty e) (Expr '[] SrcInfo)
- data SrcInfo = SrcInfo {
- _srcInfoName :: FilePath
- _srcInfoLineStart :: !Int
- _srcInfoLineEnd :: !Int
- _srcInfoColStart :: !Int
- _srcInfoColEnd :: !Int
- _srcInfoOffsetStart :: !Int
- _srcInfoOffsetEnd :: !Int
- initialSrcInfo :: FilePath -> SrcInfo
Documentation
module Language.Python.Parse.Error
:: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) | |
=> FilePath | File name |
-> Text | Input to parse |
-> Validation (NonEmpty e) (Module '[] SrcInfo) |
:: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) | |
=> FilePath | File name |
-> Text | Input to parse |
-> Validation (NonEmpty e) (Statement '[] SrcInfo) |
:: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) | |
=> FilePath | File name |
-> Text | Input to parse |
-> Validation (NonEmpty e) (Expr '[] SrcInfo) |
:: (AsLexicalError e Char, AsTabError e SrcInfo, AsIncorrectDedent e SrcInfo, AsParseError e (PyToken SrcInfo), AsIRError e SrcInfo) | |
=> FilePath | File name |
-> Text | Input to parse |
-> Validation (NonEmpty e) (Expr '[] SrcInfo) |
Parse an expression list (unparenthesised tuple)
https://docs.python.org/3.5/reference/expressions.html#grammar-token-expression_list
Source Information
SrcInfo | |
|
initialSrcInfo :: FilePath -> SrcInfo Source #