glualint-1.24.6: Attempts to fix your syntax erroring Lua files.
Safe HaskellSafe-Inferred
LanguageHaskell2010

GLua.Lexer

Description

Lex GLua into MTokens

Synopsis

Documentation

type LParser a = P (Str Char String LineColPos) a Source #

String parser that maintains positions.

parseWhitespace :: LParser String Source #

Whitespace parser that requires at least one whitespace character

parseOptionalWhitespace :: LParser String Source #

Whitespace parser that requires 0 or more whitespace characters

parseAnyChar :: LParser Char Source #

Blanco parser. Parses anything. Used in parsing comments.

parseCBlockComment :: LParser String Source #

Parses a C-style block comment.

parseBlockComment :: LParser Token Source #

Try to parse a block comment. Might actually return a single line Dash comment, because for example the following line is a line comment, rather than a block comment [===== <- missing the last '[' bracket.

pUntilEnd :: LParser String Source #

Parse the string until the end. Used in parseLineComment among others.

parseLineComment :: String -> LParser String Source #

A comment that spans until the end of the line.

nestedString :: LParser String Source #

Parses a multiline string except for its first character (e.g. =[ string ]=]) This is because the first [ could also just be parsed as a square bracket.

parseComment :: LParser Token Source #

Parse any kind of comment.

parseLineString :: Char -> LParser String Source #

Parse single line strings e.g. "sdf", werf.

parseString :: LParser Token Source #

Single and multiline strings.

parseNumber :: LParser Token Source #

Parse any kind of number.

parseKeyword :: Token -> String -> LParser Token Source #

Parse a keyword. Note: It must really a keyword! This parser makes sure to return an identifier when it's actually an identifier that starts with that keyword.

parseIdentifier :: LParser String Source #

Parse just an identifier.

parseLabel :: LParser String Source #

Parse a label.

parseDots :: LParser Token Source #

Parse anything to do with dots. Indexaction (.), concatenation (..) or varargs (...)

parseToken :: LParser Token Source #

Parse any kind of token.

annotated :: (Region -> a -> b) -> LParser a -> LParser b Source #

A thing of which the region is to be parsed

parseMToken :: LParser MToken Source #

parse located MToken

parseTokens :: LParser [MToken] Source #

Parse a list of tokens and turn them into MTokens.

parseHashBang :: LParser String Source #

Parse the potential #!comment on the first line Lua ignores the first line if it starts with #

lexFromString :: LParser a -> String -> (a, [Error LineColPos]) Source #

Lex a string with a given lexer

execParseTokens :: String -> ([MToken], [Error LineColPos]) Source #

Parse a string into MTokens. Also returns parse errors.