prism-purescript.js 1.0 KB

12345678910111213141516171819
  1. Prism.languages.purescript = Prism.languages.extend('haskell', {
  2. 'keyword': /\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,
  3. 'import-statement': {
  4. // The imported or hidden names are not included in this import
  5. // statement. This is because we want to highlight those exactly like
  6. // we do for the names in the program.
  7. pattern: /(^\s*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,
  8. lookbehind: true,
  9. inside: {
  10. 'keyword': /\b(?:import|as|hiding)\b/
  11. }
  12. },
  13. // These are builtin functions only. Constructors are highlighted later as a constant.
  14. 'builtin': /\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/,
  15. });
  16. Prism.languages.purs = Prism.languages.purescript;