Skip to content

Commit

Permalink
scala keywords taken from specs and simplified scala/java.lang
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Massé authored and marijnh committed May 30, 2012
1 parent 0964fd7 commit eb49523
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions mode/clike/clike.js
Expand Up @@ -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 cal var while with yield _ : = => <- <: " +

This comment has been minimized.

Copy link
@MasseGuillaume

MasseGuillaume May 30, 2012

Contributor
type cal var

should be

type val var

This comment has been minimized.

Copy link
@marijnh

marijnh May 31, 2012

Member

See 336f55b

This comment has been minimized.

Copy link
@MasseGuillaume

MasseGuillaume May 31, 2012

Contributor

@marijnh Thanks! I'm working on something similar to TryRuby.org I will give you more inputs soon.

"<% >: # @ " +

/* 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";
}
}
});
}());

0 comments on commit eb49523

Please sign in to comment.