mirror of
https://github.com/sdiehl/write-you-a-haskell.git
synced 2024-09-11 19:47:31 +03:00
emptyDef -> langDef
This commit is contained in:
parent
c081440b01
commit
065e55d02d
@ -13,9 +13,23 @@ import qualified Text.Parsec.Token as Tok
|
||||
|
||||
import Data.Functor.Identity
|
||||
|
||||
langDef :: Tok.LanguageDef ()
|
||||
langDef = Tok.LanguageDef
|
||||
{ Tok.commentStart = "{-"
|
||||
, Tok.commentEnd = "-}"
|
||||
, Tok.commentLine = "--"
|
||||
, Tok.nestedComments = True
|
||||
, Tok.identStart = letter
|
||||
, Tok.identLetter = alphaNum <|> oneOf "_'"
|
||||
, Tok.opStart = oneOf ":!#$%&*+./<=>?@\\^|-~"
|
||||
, Tok.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~"
|
||||
, Tok.reservedNames = []
|
||||
, Tok.reservedOpNames = []
|
||||
, Tok.caseSensitive = True
|
||||
}
|
||||
|
||||
lexer :: Tok.TokenParser ()
|
||||
lexer = Tok.makeTokenParser emptyDef
|
||||
lexer = Tok.makeTokenParser langDef
|
||||
|
||||
parens :: Parser a -> Parser a
|
||||
parens = Tok.parens lexer
|
||||
|
Loading…
Reference in New Issue
Block a user