Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

689 B
Raw Blame
// Haskell. The JS twin of haskell.py.
import { always } from './registry.mjs';

// 'x' and '\n' are character literals (may contain "); a lone ' is a prime in foo'.
const HS_CHAR = /'(?:\\.|[^\\'\n])'/y;
function haskellChar(src, i) {
  if (src[i] !== "'") return null;
  HS_CHAR.lastIndex = i;
  const m = HS_CHAR.exec(src);
  return m ? i + m[0].length : null;
}

export const LANGUAGE = {
  name: 'HASKELL',
  extensions: ['hs', 'lhs'],
  menu: [{ label: 'Haskell', ext: 'hs' }],
  syntax: {
    line: [['--', always]],
    block: [['{-', '-}', true]],
    strings: [['"', '"', true]],
    matchers: [haskellChar],
    cont: '',
    docMarkers: ['|', '^'],
    docstrings: [],
  },
};