Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- rgStart2sp :: Region -> SourcePos
- rgEnd2sp :: Region -> SourcePos
- sp2Rg :: SourcePos -> Region
- lcp2sp :: LineColPos -> SourcePos
- sp2lcp :: SourcePos -> LineColPos
- pPos :: Parser LineColPos
- pIdentifierCharacter :: Parser Char
- pNonDigitIdentifierCharacter :: Parser Char
- cBetween :: Char -> Char -> Char -> Bool
- pUntilEnd :: Parser String
- parseWhitespace :: Parser String
- parseOptionalWhitespace :: Parser String
- escapedStringChar :: Char -> Parser String
- startNestedString :: Parser String
- nestedString :: String -> Parser String
- parseLuaComment :: Parser Token
- parseCComment :: Parser Token
- parseComment :: Parser Token
- nestedStringToMLString :: String -> String -> Token
- parseLineString :: Char -> Parser String
- parseString :: Parser Token
- parseNumber :: Parser Token
- parseNumberSuffix :: Parser String
- parseKeyword :: Token -> String -> Parser Token
- parseIdentifier :: Parser String
- parseLabel :: Parser String
- parseDots :: Parser Token
- parseToken :: Parser Token
- annotated :: (Region -> a -> b) -> Parser a -> Parser b
- parseMToken :: Parser MToken
- parseTokens :: Parser [MToken]
- parseHashBang :: Parser String
- execParseTokens :: String -> Either ParseError [MToken]
Documentation
rgStart2sp :: Region -> SourcePos Source #
Region start to SourcePos
lcp2sp :: LineColPos -> SourcePos Source #
LineColPos to SourcePos
sp2lcp :: SourcePos -> LineColPos Source #
SourcePos to LineColPos
pPos :: Parser LineColPos Source #
Get the source position
pUntilEnd :: Parser String Source #
Parse the string until the end. Used in parseLineComment among others.
parseWhitespace :: Parser String Source #
Whitespace parser that requires at least one whitespace character
parseOptionalWhitespace :: Parser String Source #
Whitespace parser that requires 0 or more whitespace characters
escapedStringChar :: Char -> Parser String Source #
An escaped character of a single line string Takes the delimiter of the string as parameter
startNestedString :: Parser String Source #
The start of a nested string Returns the amount of =-signs at the start of the nested string
nestedString :: String -> Parser String Source #
Parses a multiline string returns the amount of =-signs in the string delimiter and the contents
parseLuaComment :: Parser Token Source #
Parse Lua style comments
parseCComment :: Parser Token Source #
Parse C-Style comments
parseComment :: Parser Token Source #
Parse any kind of comment.
nestedStringToMLString :: String -> String -> Token Source #
Convert the result of the nestedString parser to a MultiLine string
parseString :: Parser Token Source #
Single and multiline strings.
parseNumber :: Parser Token Source #
Parse any kind of number.
Except for numbers that start with a .
. That's handled by parseDots to solve ambiguity.
parseKeyword :: Token -> String -> Parser Token Source #
Parse either a keyword or an identifier that starts with that keyword
parseIdentifier :: Parser String Source #
Parse just an identifier.
parseLabel :: Parser String Source #
Parse a label.
parseDots :: Parser Token Source #
Parse anything to do with dots. Indexaction (.), concatenation (..), varargs (...) or numbers that start with a dot
parseToken :: Parser Token Source #
Parse any kind of token.
annotated :: (Region -> a -> b) -> Parser a -> Parser b Source #
A thing of which the region is to be parsed
parseMToken :: Parser MToken Source #
parse located MToken
parseTokens :: Parser [MToken] Source #
Parse a list of tokens and turn them into MTokens.
parseHashBang :: Parser String Source #
Parse the potential #!comment on the first line Lua ignores the first line if it starts with #
execParseTokens :: String -> Either ParseError [MToken] Source #
Parse a string into MTokens.