Safe Haskell | None |
---|---|
Language | Haskell2010 |
- parseTokens :: Parser a -> [LexToken] -> Either (SourceRange, String) a
- parseText :: Parser a -> Text -> Either (SourceRange, String) a
- parseNamedText :: Parser a -> String -> Text -> Either (SourceRange, String) a
- parseFile :: FilePath -> IO (Either (SourceRange, String) (Block SourceRange))
- data Parser a
- chunk :: Parser (Block SourceRange)
- exp :: Parser (Exp SourceRange)
- stat :: Parser (Stat SourceRange)
- data SourcePos = SourcePos {}
- data SourceRange = SourceRange {
- sourceFrom :: !SourcePos
- sourceTo :: !SourcePos
Documentation
parseTokens :: Parser a -> [LexToken] -> Either (SourceRange, String) a Source #
Parse a stream of tokens.
:: Parser a | |
-> Text | chunk |
-> Either (SourceRange, String) a |
Runs Lua lexer before parsing. Use parseText stat
to parse
statements, and parseText exp
to parse expressions.
Runs Lua lexer before parsing. Use parseNamedText stat "name"
to parse
statements, and parseText exp "name"
to parse expressions.
parseFile :: FilePath -> IO (Either (SourceRange, String) (Block SourceRange)) Source #
Parse a Lua file. You can use parseText chunk
to parse a file from a string.
The type of locations in a source file