| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | exports.ada = { LINE_REGEX: /^--.*/ };
|
|---|
| 4 | exports.apl = { LINE_REGEX: /^⍝.*/ };
|
|---|
| 5 |
|
|---|
| 6 | exports.applescript = {
|
|---|
| 7 | BLOCK_OPEN_REGEX: /^\(\*/,
|
|---|
| 8 | BLOCK_CLOSE_REGEX: /^\*\)/
|
|---|
| 9 | };
|
|---|
| 10 |
|
|---|
| 11 | exports.csharp = {
|
|---|
| 12 | LINE_REGEX: /^\/\/.*/
|
|---|
| 13 | };
|
|---|
| 14 |
|
|---|
| 15 | exports.haskell = {
|
|---|
| 16 | BLOCK_OPEN_REGEX: /^\{-/,
|
|---|
| 17 | BLOCK_CLOSE_REGEX: /^-\}/,
|
|---|
| 18 | LINE_REGEX: /^--.*/
|
|---|
| 19 | };
|
|---|
| 20 |
|
|---|
| 21 | exports.html = {
|
|---|
| 22 | BLOCK_OPEN_REGEX: /^\n*<!--(?!-?>)/,
|
|---|
| 23 | BLOCK_CLOSE_REGEX: /^(?<!(?:<!-))-->/,
|
|---|
| 24 | BLOCK_CLOSE_LOOSE_REGEX: /^(?<!(?:<!-))--\s*>/,
|
|---|
| 25 | BLOCK_CLOSE_STRICT_NEWLINE_REGEX: /^(?<!(?:<!-))-->(\s*\n+|\n*)/,
|
|---|
| 26 | BLOCK_CLOSE_STRICT_LOOSE_REGEX: /^(?<!(?:<!-))--\s*>(\s*\n+|\n*)/
|
|---|
| 27 | };
|
|---|
| 28 |
|
|---|
| 29 | exports.javascript = {
|
|---|
| 30 | BLOCK_OPEN_REGEX: /^\/\*\*?(!?)/,
|
|---|
| 31 | BLOCK_CLOSE_REGEX: /^\*\/(\n?)/,
|
|---|
| 32 | LINE_REGEX: /^\/\/(!?).*/
|
|---|
| 33 | };
|
|---|
| 34 |
|
|---|
| 35 | exports.lua = {
|
|---|
| 36 | BLOCK_OPEN_REGEX: /^--\[\[/,
|
|---|
| 37 | BLOCK_CLOSE_REGEX: /^\]\]/,
|
|---|
| 38 | LINE_REGEX: /^--.*/
|
|---|
| 39 | };
|
|---|
| 40 |
|
|---|
| 41 | exports.matlab = {
|
|---|
| 42 | BLOCK_OPEN_REGEX: /^%{/,
|
|---|
| 43 | BLOCK_CLOSE_REGEX: /^%}/,
|
|---|
| 44 | LINE_REGEX: /^%.*/
|
|---|
| 45 | };
|
|---|
| 46 |
|
|---|
| 47 | exports.perl = {
|
|---|
| 48 | LINE_REGEX: /^#.*/
|
|---|
| 49 | };
|
|---|
| 50 |
|
|---|
| 51 | exports.php = {
|
|---|
| 52 | ...exports.javascript,
|
|---|
| 53 | LINE_REGEX: /^(#|\/\/).*?(?=\?>|\n)/
|
|---|
| 54 | };
|
|---|
| 55 |
|
|---|
| 56 | exports.python = {
|
|---|
| 57 | BLOCK_OPEN_REGEX: /^"""/,
|
|---|
| 58 | BLOCK_CLOSE_REGEX: /^"""/,
|
|---|
| 59 | LINE_REGEX: /^#.*/
|
|---|
| 60 | };
|
|---|
| 61 |
|
|---|
| 62 | exports.ruby = {
|
|---|
| 63 | BLOCK_OPEN_REGEX: /^=begin/,
|
|---|
| 64 | BLOCK_CLOSE_REGEX: /^=end/,
|
|---|
| 65 | LINE_REGEX: /^#.*/
|
|---|
| 66 | };
|
|---|
| 67 |
|
|---|
| 68 | exports.shebang = exports.hashbang = {
|
|---|
| 69 | LINE_REGEX: /^#!.*/
|
|---|
| 70 | };
|
|---|
| 71 |
|
|---|
| 72 | exports.c = exports.javascript;
|
|---|
| 73 | exports.csharp = exports.javascript;
|
|---|
| 74 | exports.css = exports.javascript;
|
|---|
| 75 | exports.java = exports.javascript;
|
|---|
| 76 | exports.js = exports.javascript;
|
|---|
| 77 | exports.less = exports.javascript;
|
|---|
| 78 | exports.pascal = exports.applescript;
|
|---|
| 79 | exports.ocaml = exports.applescript;
|
|---|
| 80 | exports.sass = exports.javascript;
|
|---|
| 81 | exports.sql = exports.ada;
|
|---|
| 82 | exports.swift = exports.javascript;
|
|---|
| 83 | exports.ts = exports.javascript;
|
|---|
| 84 | exports.typscript = exports.javascript;
|
|---|
| 85 | exports.xml = exports.html;
|
|---|