/* Language: Haskell Author: Jeremy Hull Contributors: Zena Treep Website: https://www.haskell.org Category: functional */ function haskell(hljs) { /* See: - https://www.haskell.org/onlinereport/lexemes.html - https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/binary_literals.html - https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/numeric_underscores.html - https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/hex_float_literals.html */ const decimalDigits = '([0-9]_*)+'; const hexDigits = '([0-9a-fA-F]_*)+'; const binaryDigits = '([01]_*)+'; const octalDigits = '([0-7]_*)+'; const ascSymbol = '[!#$%&*+.\\/<=>?@\\\\^~-]'; const uniSymbol = '(\\p{S}|\\p{P})'; // Symbol or Punctuation const special = '[(),;\\[\\]`|{}]'; const symbol = `(${ascSymbol}|(?!(${special}|[_:"']))${uniSymbol})`; const COMMENT = { variants: [ // Double dash forms a valid comment only if it's not part of legal lexeme. // See: Haskell 98 report: https://www.haskell.org/onlinereport/lexemes.html // // The commented code does the job, but we can't use negative lookbehind, // due to poor support by Safari browser. // > hljs.COMMENT(`(?|<-' } ] }; } export { haskell as default };