HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleparsec-3.1.18.0Haskell2010

Text.ParserCombinators.Parsec.Language

Parsec compatibility module

  • 2 types
  • 7 values
  • Packageparsec-3.1.18.0
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceLanguage.hs
valueemptyDef :: LanguageDef st
#

This is the most minimal token definition. It is recommended to use this definition as the basis for other definitions. emptyDef has no reserved names or operators, is case sensitive and doesn't accept comments, identifiers or operators.

valuehaskellStyle :: LanguageDef st
#

This is a minimal token definition for Haskell style languages. It defines the style of comments, valid identifiers and case sensitivity. It does not define any reserved words or operators.

valuejavaStyle :: LanguageDef st
#

This is a minimal token definition for Java style languages. It defines the style of comments, valid identifiers and case sensitivity. It does not define any reserved words or operators.

datadata GenLanguageDef s u (m :: Type -> Type)
#

The GenLanguageDef type is a record that contains all parameterizable features of the Text.Parsec.Token module. The module Text.Parsec.Language contains some default definitions.

Constructors

  • LanguageDef
    • commentStart :: String

      Describes the start of a block comment. Use the empty string if the language doesn't support block comments. For example "/*".

    • commentEnd :: String

      Describes the end of a block comment. Use the empty string if the language doesn't support block comments. For example "*/".

    • commentLine :: String

      Describes the start of a line comment. Use the empty string if the language doesn't support line comments. For example "//".

    • nestedComments :: Bool

      Set to True if the language supports nested block comments.

    • identStart :: ParsecT s u m Char

      This parser should accept any start characters of identifiers. For example letter <|> char '_'.

    • identLetter :: ParsecT s u m Char

      This parser should accept any legal tail characters of identifiers. For example alphaNum <|> char '_'.

    • opStart :: ParsecT s u m Char

      This parser should accept any start characters of operators. For example oneOf ":!#$%&*+./<=>?@\\^|-~"

    • opLetter :: ParsecT s u m Char

      This parser should accept any legal tail characters of operators. Note that this parser should even be defined if the language doesn't support user-defined operators, or otherwise the reservedOp parser won't work correctly.

    • reservedNames :: [String]

      The list of reserved identifiers.

    • reservedOpNames :: [String]

      The list of reserved operators.

    • caseSensitive :: Bool

      Set to True if the language is case sensitive.