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.

571 B
Raw Blame
// Shell: sh, bash, zsh. The JS twin of shell.py.
import { isSpace } from '../pychars.mjs';

// # opens a comment only at a word boundary: ${x#y} and a#b stay code.
const shellHash = (src, i) => i === 0 || isSpace(src[i - 1]) || ';&|()`'.includes(src[i - 1]);

export const LANGUAGE = {
  name: 'SHELL',
  extensions: ['sh', 'bash', 'zsh'],
  menu: [{ label: 'Shell', ext: 'sh' }],
  syntax: {
    line: [['#', shellHash]],
    block: [],
    strings: [['"', '"', true], ["'", "'", false]],
    matchers: [],
    cont: '',
    docMarkers: [],
    docstrings: [],
  },
};