From 4b0ca55eb79e963523eb6c8197825e9e8ae904e2 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Mon, 4 May 2015 15:53:29 +0800 Subject: First commit, version 0.2.7 --- public/vendor/codemirror/mode/dart/dart.js | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 public/vendor/codemirror/mode/dart/dart.js (limited to 'public/vendor/codemirror/mode/dart/dart.js') diff --git a/public/vendor/codemirror/mode/dart/dart.js b/public/vendor/codemirror/mode/dart/dart.js new file mode 100755 index 00000000..a49e218c --- /dev/null +++ b/public/vendor/codemirror/mode/dart/dart.js @@ -0,0 +1,50 @@ +// 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"); +}); -- cgit v1.2.3