summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode/clike/index.html
diff options
context:
space:
mode:
authorWu Cheng-Han2016-01-17 14:28:04 -0600
committerWu Cheng-Han2016-01-17 14:28:04 -0600
commiteaa8ccaccb1091820d0a8d1223996a6dd057347d (patch)
tree6b4aaa3b3d1a2fed68147510142663222533775a /public/vendor/codemirror/mode/clike/index.html
parentce65e58096d57ace02723d11a125673f9d48c293 (diff)
Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
Diffstat (limited to 'public/vendor/codemirror/mode/clike/index.html')
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/index.html111
1 files changed, 110 insertions, 1 deletions
diff --git a/public/vendor/codemirror/mode/clike/index.html b/public/vendor/codemirror/mode/clike/index.html
index 8b386d22..45c670ae 100755..100644
--- a/public/vendor/codemirror/mode/clike/index.html
+++ b/public/vendor/codemirror/mode/clike/index.html
@@ -206,6 +206,103 @@ object FilterTest extends App {
}
</textarea></div>
+<h2>Kotlin mode</h2>
+
+<div><textarea id="kotlin-code">
+package org.wasabi.http
+
+import java.util.concurrent.Executors
+import java.net.InetSocketAddress
+import org.wasabi.app.AppConfiguration
+import io.netty.bootstrap.ServerBootstrap
+import io.netty.channel.nio.NioEventLoopGroup
+import io.netty.channel.socket.nio.NioServerSocketChannel
+import org.wasabi.app.AppServer
+
+public class HttpServer(private val appServer: AppServer) {
+
+ val bootstrap: ServerBootstrap
+ val primaryGroup: NioEventLoopGroup
+ val workerGroup: NioEventLoopGroup
+
+ init {
+ // Define worker groups
+ primaryGroup = NioEventLoopGroup()
+ workerGroup = NioEventLoopGroup()
+
+ // Initialize bootstrap of server
+ bootstrap = ServerBootstrap()
+
+ bootstrap.group(primaryGroup, workerGroup)
+ bootstrap.channel(javaClass<NioServerSocketChannel>())
+ bootstrap.childHandler(NettyPipelineInitializer(appServer))
+ }
+
+ public fun start(wait: Boolean = true) {
+ val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
+
+ if (wait) {
+ channel?.closeFuture()?.sync()
+ }
+ }
+
+ public fun stop() {
+ // Shutdown all event loops
+ primaryGroup.shutdownGracefully()
+ workerGroup.shutdownGracefully()
+
+ // Wait till all threads are terminated
+ primaryGroup.terminationFuture().sync()
+ workerGroup.terminationFuture().sync()
+ }
+}
+</textarea></div>
+
+<h2>Ceylon mode</h2>
+
+<div><textarea id="ceylon-code">
+"Produces the [[stream|Iterable]] that results from repeated
+ application of the given [[function|next]] to the given
+ [[first]] element of the stream, until the function first
+ returns [[finished]]. If the given function never returns
+ `finished`, the resulting stream is infinite.
+
+ For example:
+
+ loop(0)(2.plus).takeWhile(10.largerThan)
+
+ produces the stream `{ 0, 2, 4, 6, 8 }`."
+tagged("Streams")
+shared {Element+} loop&lt;Element&gt;(
+ "The first element of the resulting stream."
+ Element first)(
+ "The function that produces the next element of the
+ stream, given the current element. The function may
+ return [[finished]] to indicate the end of the
+ stream."
+ Element|Finished next(Element element))
+ =&gt; let (start = first)
+ object satisfies {Element+} {
+ first =&gt; start;
+ empty =&gt; false;
+ function nextElement(Element element)
+ =&gt; next(element);
+ iterator()
+ =&gt; object satisfies Iterator&lt;Element&gt; {
+ variable Element|Finished current = start;
+ shared actual Element|Finished next() {
+ if (!is Finished result = current) {
+ current = nextElement(result);
+ return result;
+ }
+ else {
+ return finished;
+ }
+ }
+ };
+ };
+</textarea></div>
+
<script>
var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
lineNumbers: true,
@@ -232,6 +329,16 @@ object FilterTest extends App {
matchBrackets: true,
mode: "text/x-scala"
});
+ var kotlinEditor = CodeMirror.fromTextArea(document.getElementById("kotlin-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-kotlin"
+ });
+ var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-ceylon"
+ });
var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
</script>
@@ -247,5 +354,7 @@ object FilterTest extends App {
(Java), <code>text/x-csharp</code> (C#),
<code>text/x-objectivec</code> (Objective-C),
<code>text/x-scala</code> (Scala), <code>text/x-vertex</code>
- and <code>x-shader/x-fragment</code> (shader programs).</p>
+ <code>x-shader/x-fragment</code> (shader programs),
+ <code>text/x-squirrel</code> (Squirrel) and
+ <code>text/x-ceylon</code> (Ceylon)</p>
</article>