public/js/vendor/codemirror3/mode/haskell/haskell.js
function normal(source, setState) {
    if (source.eatWhile(whiteCharRE)) {
      return null;
    }

    var ch = source.next();
    if (specialRE.test(ch)) {
      if (ch == '{' && source.eat('-')) {
        var t = "comment";
        if (source.eat('#')) {
          t = "meta";
        }
        return switchState(source, setState, ncomment(t, 1));
      }
      return null;
    }

    if (ch == '\'') {
      if (source.eat('\\')) {
        source.next();  // should handle other escapes here
      }
      else {
        source.next();
      }
      if (source.eat('\'')) {
        return "string";
      }
      return "error";
    }

    if (ch == '"') {
      return switchState(source, setState, stringLiteral);
    }

    if (largeRE.test(ch)) {
      source.eatWhile(idRE);
      if (source.eat('.')) {
        return "qualifier";
      }
      return "variable-2";
    }

    if (smallRE.test(ch)) {
      source.eatWhile(idRE);
      return "variable";
    }

    if (digitRE.test(ch)) {
      if (ch == '0') {
        if (source.eat(/[xX]/)) {
          source.eatWhile(hexitRE); // should require at least 1
          return "integer";
        }
        if (source.eat(/[oO]/)) {
          source.eatWhile(octitRE); // should require at least 1
          return "number";
        }
      }
      source.eatWhile(digitRE);
      var t = "number";
      if (source.match(/^\.\d+/)) {
        t = "number";
      }
      if (source.eat(/[eE]/)) {
        t = "number";
        source.eat(/[-+]/);
        source.eatWhile(digitRE); // should require at least 1
      }
      return t;
    }

    if (ch == "." && source.eat("."))
      return "keyword";

    if (symbolRE.test(ch)) {
      if (ch == '-' && source.eat(/-/)) {
        source.eatWhile(/-/);
        if (!source.eat(symbolRE)) {
          source.skipToEnd();
          return "comment";
        }
      }
      var t = "variable";
      if (ch == ':') {
        t = "variable-2";
      }
      source.eatWhile(symbolRE);
      return t;
    }

    return "error";
  }
function normal(source, setState) {
    if (source.eatWhile(whiteCharRE)) {
      return null;
    }

    var ch = source.next();
    if (specialRE.test(ch)) {
      if (ch == '{' && source.eat('-')) {
        var t = "comment";
        if (source.eat('#')) {
          t = "meta";
        }
        return switchState(source, setState, ncomment(t, 1));
      }
      return null;
    }

    if (ch == '\'') {
      if (source.eat('\\')) {
        source.next();  // should handle other escapes here
      }
      else {
        source.next();
      }
      if (source.eat('\'')) {
        return "string";
      }
      return "error";
    }

    if (ch == '"') {
      return switchState(source, setState, stringLiteral);
    }

    if (largeRE.test(ch)) {
      source.eatWhile(idRE);
      if (source.eat('.')) {
        return "qualifier";
      }
      return "variable-2";
    }

    if (smallRE.test(ch)) {
      source.eatWhile(idRE);
      return "variable";
    }

    if (digitRE.test(ch)) {
      if (ch == '0') {
        if (source.eat(/[xX]/)) {
          source.eatWhile(hexitRE); // should require at least 1
          return "integer";
        }
        if (source.eat(/[oO]/)) {
          source.eatWhile(octitRE); // should require at least 1
          return "number";
        }
      }
      source.eatWhile(digitRE);
      var t = "number";
      if (source.match(/^\.\d+/)) {
        t = "number";
      }
      if (source.eat(/[eE]/)) {
        t = "number";
        source.eat(/[-+]/);
        source.eatWhile(digitRE); // should require at least 1
      }
      return t;
    }

    if (ch == "." && source.eat("."))
      return "keyword";

    if (symbolRE.test(ch)) {
      if (ch == '-' && source.eat(/-/)) {
        source.eatWhile(/-/);
        if (!source.eat(symbolRE)) {
          source.skipToEnd();
          return "comment";
        }
      }
      var t = "variable";
      if (ch == ':') {
        t = "variable-2";
      }
      source.eatWhile(symbolRE);
      return t;
    }

    return "error";
  }
function normal ( source , setState ) { if ( source . eatWhile ( whiteCharRE ) ) { return null ; } var ch = source . next ( ) ; if ( specialRE . test ( ch ) ) { if ( ch == '{' && source . eat ( '-' ) ) { var t = "comment" ; if ( source . eat ( '#' ) ) { t = "meta" ; } return switchState ( source , setState , ncomment ( t , 1 ) ) ; } return null ; } if ( ch == '\'' ) { if ( source . eat ( '\\' ) ) { source . next ( ) ; // should handle other escapes here } else { source . next ( ) ; } if ( source . eat ( '\'' ) ) { return "string" ; } return "error" ; } if ( ch == '"' ) { return switchState ( source , setState , stringLiteral ) ; } if ( largeRE . test ( ch ) ) { source . eatWhile ( idRE ) ; if ( source . eat ( '.' ) ) { return "qualifier" ; } return "variable-2" ; } if ( smallRE . test ( ch ) ) { source . eatWhile ( idRE ) ; return "variable" ; } if ( digitRE . test ( ch ) ) { if ( ch == '0' ) { if ( source . eat ( / [xX] / ) ) { source . eatWhile ( hexitRE ) ; // should require at least 1 return "integer" ; } if ( source . eat ( / [oO] / ) ) { source . eatWhile ( octitRE ) ; // should require at least 1 return "number" ; } } source . eatWhile ( digitRE ) ; var t = "number" ; if ( source . match ( / ^\.\d+ / ) ) { t = "number" ; } if ( source . eat ( / [eE] / ) ) { t = "number" ; source . eat ( / [-+] / ) ; source . eatWhile ( digitRE ) ; // should require at least 1 } return t ; } if ( ch == "." && source . eat ( "." ) ) return "keyword" ; if ( symbolRE . test ( ch ) ) { if ( ch == '-' && source . eat ( / - / ) ) { source . eatWhile ( / - / ) ; if ( ! source . eat ( symbolRE ) ) { source . skipToEnd ( ) ; return "comment" ; } } var t = "variable" ; if ( ch == ':' ) { t = "variable-2" ; } source . eatWhile ( symbolRE ) ; return t ; } return "error" ; }
newlines are handled in tokenizer
newlines are handled in tokenizer