Sha256: f3dff4171108d262009ef0a816999b2d5c8186f3982428a24b7096aea8fc4c0f

Contents?: true

Size: 1.78 KB

Versions: 36

Compression:

Stored size: 1.78 KB

Contents

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"), require("../clike/clike"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror", "../clike/clike"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
  "use strict";

  var keywords = ("this super static final const abstract class extends external factory " +
    "implements get native operator set typedef with enum throw rethrow " +
    "assert break case continue default in return new deferred async await " +
    "try catch finally do else for if switch while import library export " +
    "part of show hide is").split(" ");
  var blockKeywords = "try catch finally do else for if switch while".split(" ");
  var atoms = "true false null".split(" ");
  var builtins = "void bool num int double dynamic var String".split(" ");

  function set(words) {
    var obj = {};
    for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
    return obj;
  }

  CodeMirror.defineMIME("application/dart", {
    name: "clike",
    keywords: set(keywords),
    multiLineStrings: true,
    blockKeywords: set(blockKeywords),
    builtin: set(builtins),
    atoms: set(atoms),
    hooks: {
      "@": function(stream) {
        stream.eatWhile(/[\w\$_]/);
        return "meta";
      }
    }
  });

  CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));

  // This is needed to make loading through meta.js work.
  CodeMirror.defineMode("dart", function(conf) {
    return CodeMirror.getMode(conf, "application/dart");
  }, "clike");
});

Version data entries

36 entries across 36 versions & 5 rubygems

Version Path
jeygeethanmedia-inkpen-1.2.6.2 public/codemirror/mode/dart/dart.js
jeygeethanmedia-inkpen-1.2.6.1 public/codemirror/mode/dart/dart.js
lines-engine-1.2.6.1 public/codemirror/mode/dart/dart.js
lines-engine-1.2.6 public/codemirror/mode/dart/dart.js
lines-engine-1.2.5 public/codemirror/mode/dart/dart.js
lines-engine-1.2.3 public/codemirror/mode/dart/dart.js
lines-engine-1.2.2 public/codemirror/mode/dart/dart.js
lines-engine-1.2.1.1 public/codemirror/mode/dart/dart.js
lines-engine-1.2.1 public/codemirror/mode/dart/dart.js
lines-engine-1.2 public/codemirror/mode/dart/dart.js
lines-engine-1.1.5.3 public/codemirror/mode/dart/dart.js
lines-engine-1.1.5.2 public/codemirror/mode/dart/dart.js
lines-engine-1.1.5.1 public/codemirror/mode/dart/dart.js
lines-engine-1.1.5 public/codemirror/mode/dart/dart.js
lines-engine-1.1.4 public/codemirror/mode/dart/dart.js
lines-engine-1.1.3 public/codemirror/mode/dart/dart.js
codemirror-rails-5.7 vendor/assets/javascripts/codemirror/modes/dart.js
lines-engine-1.1.2 public/codemirror/mode/dart/dart.js
lines-engine-1.1.1 public/codemirror/mode/dart/dart.js
lines-engine-1.1.0 public/codemirror/mode/dart/dart.js