| Copyright | (c) Edward Kmett 2011-2012 | 
|---|---|
| License | BSD3 | 
| Maintainer | ekmett@gmail.com | 
| Stability | provisional | 
| Portability | non-portable | 
| Safe Haskell | Trustworthy | 
| Language | Haskell2010 | 
Text.Parser.Token.Style
Description
A toolbox for specifying comment and identifier styles
This must be imported directly as it is not re-exported elsewhere
Synopsis
- data CommentStyle = CommentStyle {}
 - commentStart :: Functor f => (String -> f String) -> CommentStyle -> f CommentStyle
 - commentEnd :: Functor f => (String -> f String) -> CommentStyle -> f CommentStyle
 - commentLine :: Functor f => (String -> f String) -> CommentStyle -> f CommentStyle
 - commentNesting :: Functor f => (Bool -> f Bool) -> CommentStyle -> f CommentStyle
 - emptyCommentStyle :: CommentStyle
 - javaCommentStyle :: CommentStyle
 - scalaCommentStyle :: CommentStyle
 - haskellCommentStyle :: CommentStyle
 - buildSomeSpaceParser :: CharParsing m => m () -> CommentStyle -> m ()
 - emptyIdents :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m
 - haskellIdents :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m
 - haskell98Idents :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m
 - emptyOps :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m
 - haskellOps :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m
 - haskell98Ops :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m
 
Comment and white space styles
data CommentStyle Source #
How to deal with comments.
Constructors
| CommentStyle | |
Fields 
  | |
Instances
Lenses
commentStart :: Functor f => (String -> f String) -> CommentStyle -> f CommentStyle Source #
This is a lens that can edit the string that starts a multiline comment.
commentStart:: Lens'CommentStyleString
commentEnd :: Functor f => (String -> f String) -> CommentStyle -> f CommentStyle Source #
This is a lens that can edit the string that ends a multiline comment.
commentEnd:: Lens'CommentStyleString
commentLine :: Functor f => (String -> f String) -> CommentStyle -> f CommentStyle Source #
This is a lens that can edit the string that starts a single line comment.
commentLine:: Lens'CommentStyleString
commentNesting :: Functor f => (Bool -> f Bool) -> CommentStyle -> f CommentStyle Source #
This is a lens that can edit whether we can nest multiline comments.
commentNesting:: Lens'CommentStyleBool
Common Comment Styles
emptyCommentStyle :: CommentStyle Source #
No comments at all
javaCommentStyle :: CommentStyle Source #
Use java-style comments
scalaCommentStyle :: CommentStyle Source #
Use scala-style comments
haskellCommentStyle :: CommentStyle Source #
Use haskell-style comments
buildSomeSpaceParser :: CharParsing m => m () -> CommentStyle -> m () Source #
Use this to easily build the definition of whiteSpace for your MonadParser given a comment style and an underlying someWhiteSpace parser
Identifier Styles
emptyIdents :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m Source #
A simple identifier style based on haskell with no reserve words
haskellIdents :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m Source #
A simple identifier style based on haskell with the reserved words from Haskell 98 and some common extensions.
haskell98Idents :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m Source #
A simple identifier style based on haskell with only the reserved words from Haskell 98.
Operator Styles
emptyOps :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m Source #
A simple operator style based on haskell with no reserved operators
haskellOps :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m Source #
A simple operator style based on haskell with the operators from Haskell 98.
haskell98Ops :: forall (m :: Type -> Type). TokenParsing m => IdentifierStyle m Source #
A simple operator style based on haskell with the operators from Haskell 98.