prism-agda.js 860 B

123456789101112131415161718192021222324
  1. (function (Prism) {
  2. Prism.languages.agda = {
  3. 'comment': /\{-[\s\S]*?(?:-\}|$)|--.*/,
  4. 'string': {
  5. pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
  6. greedy: true,
  7. },
  8. 'punctuation': /[(){}⦃⦄.;@]/,
  9. 'class-name': {
  10. pattern: /((?:data|record) +)\S+/,
  11. lookbehind: true,
  12. },
  13. 'function': {
  14. pattern: /(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m,
  15. lookbehind: true,
  16. },
  17. 'operator': {
  18. pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/,
  19. lookbehind: true,
  20. },
  21. 'keyword': /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/,
  22. };
  23. }(Prism));