LaravelTest
43 строки · 1.4 Кб
1// CodeMirror, copyright (c) by Marijn Haverbeke and others
2// Distributed under an MIT license: https://codemirror.net/LICENSE
3
4(function (mod) {5if (typeof exports == "object" && typeof module == "object") // CommonJS6mod(require("../../lib/codemirror"), require("../haskell/haskell"))7else if (typeof define == "function" && define.amd) // AMD8define(["../../lib/codemirror", "../haskell/haskell"], mod)9else // Plain browser env10mod(CodeMirror)11})(function (CodeMirror) {12"use strict"13
14CodeMirror.defineMode("haskell-literate", function (config, parserConfig) {15var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell")16
17return {18startState: function () {19return {20inCode: false,21baseState: CodeMirror.startState(baseMode)22}23},24token: function (stream, state) {25if (stream.sol()) {26if (state.inCode = stream.eat(">"))27return "meta"28}29if (state.inCode) {30return baseMode.token(stream, state.baseState)31} else {32stream.skipToEnd()33return "comment"34}35},36innerMode: function (state) {37return state.inCode ? {state: state.baseState, mode: baseMode} : null38}39}40}, "haskell")41
42CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate")43});44