hpython-0.2: Python language tools

Copyright(C) CSIRO 2017-2019
LicenseBSD3
MaintainerIsaac Elliott <isaace71295@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Language.Python.Internal.Parse

Contents

Description

 
Synopsis

Documentation

runParser Source #

Arguments

:: AsParseError e (PyToken SrcInfo) 
=> FilePath

File name

-> Parser a

Parser

-> [PyToken SrcInfo]

Input to parse

-> Either e a 

Run a parser on some input

Stream type

newtype PyTokens Source #

Constructors

PyTokens 
Instances
Eq PyTokens Source # 
Instance details

Defined in Language.Python.Internal.Parse

Ord PyTokens Source # 
Instance details

Defined in Language.Python.Internal.Parse

Stream PyTokens Source # 
Instance details

Defined in Language.Python.Internal.Parse

Associated Types

type Token PyTokens :: Type #

type Tokens PyTokens :: Type #

type Tokens PyTokens Source # 
Instance details

Defined in Language.Python.Internal.Parse

type Token PyTokens Source # 
Instance details

Defined in Language.Python.Internal.Parse

Errors

unsafeFromParseError :: (HasCallStack, AsParseError s t) => ParseError t e -> s Source #

Convert a concrete ParseError to a value that has an instance of AsParseError

This function is partial because our parser will never use FancyError

Parsers

Symbols

Atomic forms

Compound forms

commaSepRest :: MonadParsec e PyTokens m => m b -> m ([(Comma, b)], Maybe Comma) Source #

Formatting

Miscellaneous combinators

sepBy1' :: MonadParsec e PyTokens m => m a -> m sep -> m (a, [(sep, a)], Maybe sep) Source #