From 0e04fff0ea80fa5cbe96b8354db38bd334aea83a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 16 Jul 2012 16:04:05 -0700 Subject: upgrade to codemirror 2.3 Signed-off-by: Ananya Sen Conflicts: js/code-editor/codemirror-ninja/theme/lesser-dark-ninja.css Signed-off-by: Ananya Sen --- imports/codemirror/mode/clike/clike.js | 39 +- imports/codemirror/mode/clike/scala.html | 765 +++++++++++++++++++++++++++++++ 2 files changed, 803 insertions(+), 1 deletion(-) create mode 100644 imports/codemirror/mode/clike/scala.html (limited to 'imports/codemirror/mode/clike') diff --git a/imports/codemirror/mode/clike/clike.js b/imports/codemirror/mode/clike/clike.js index 66443fb8..0e7f48b6 100644 --- a/imports/codemirror/mode/clike/clike.js +++ b/imports/codemirror/mode/clike/clike.js @@ -21,7 +21,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { } if (/[\[\]{}\(\),;\:\.]/.test(ch)) { curPunc = ch; - return null + return null; } if (/\d/.test(ch)) { stream.eatWhile(/[\w\.]/); @@ -231,4 +231,41 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { } } }); + CodeMirror.defineMIME("text/x-scala", { + name: "clike", + keywords: words( + + /* scala */ + "abstract case catch class def do else extends false final finally for forSome if " + + "implicit import lazy match new null object override package private protected return " + + "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " + + "<% >: # @ " + + + /* package scala */ + "assert assume require print println printf readLine readBoolean readByte readShort " + + "readChar readInt readLong readFloat readDouble " + + + "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + + "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " + + "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + + "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + + "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " + + + /* package java.lang */ + "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + + "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + + "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + + "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" + + + ), + blockKeywords: words("catch class do else finally for forSome if match switch try while"), + atoms: words("true false null"), + hooks: { + "@": function(stream, state) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); }()); diff --git a/imports/codemirror/mode/clike/scala.html b/imports/codemirror/mode/clike/scala.html new file mode 100644 index 00000000..5fdd84ed --- /dev/null +++ b/imports/codemirror/mode/clike/scala.html @@ -0,0 +1,765 @@ + + + + CodeMirror: C-like mode + + + + + + + + +
+ +
+ + + + -- cgit v1.2.3