| 776 |
lars |
1 |
<!doctype html>
|
|
|
2 |
<title>CodeMirror: Factor mode</title>
|
|
|
3 |
<meta charset="utf-8" />
|
|
|
4 |
<link rel=stylesheet href="../../doc/docs.css">
|
|
|
5 |
<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
|
|
6 |
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
|
7 |
<script src="../../lib/codemirror.js"></script>
|
|
|
8 |
<script src="../../addon/mode/simple.js"></script>
|
|
|
9 |
<script src="factor.js"></script>
|
|
|
10 |
<style>
|
|
|
11 |
.CodeMirror {
|
|
|
12 |
font-family: 'Droid Sans Mono', monospace;
|
|
|
13 |
font-size: 14px;
|
|
|
14 |
}
|
|
|
15 |
</style>
|
|
|
16 |
<div id=nav>
|
|
|
17 |
<a href="http://codemirror.net">
|
|
|
18 |
<h1>CodeMirror</h1>
|
|
|
19 |
<img id=logo src="../../doc/logo.png">
|
|
|
20 |
</a>
|
|
|
21 |
<ul>
|
|
|
22 |
<li>
|
|
|
23 |
<a href="../../index.html">Home</a>
|
|
|
24 |
<li>
|
|
|
25 |
<a href="../../doc/manual.html">Manual</a>
|
|
|
26 |
<li>
|
|
|
27 |
<a href="https://github.com/codemirror/codemirror">Code</a>
|
|
|
28 |
</ul>
|
|
|
29 |
<ul>
|
|
|
30 |
<li>
|
|
|
31 |
<a href="../index.html">Language modes</a>
|
|
|
32 |
<li>
|
|
|
33 |
<a class=active href="#">Factor</a>
|
|
|
34 |
</ul>
|
|
|
35 |
</div>
|
|
|
36 |
<article>
|
|
|
37 |
<h2>Factor mode</h2>
|
|
|
38 |
<form>
|
|
|
39 |
<textarea id="code" name="code"> ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. ! A simple time server USING: accessors calendar calendar.format io io.encodings.ascii io.servers kernel threads ; IN: time-server : handle-time-client
|
|
|
40 |
( -- ) now timestamp>rfc822 print ; :
|
|
|
41 |
<time-server> ( -- threaded-server ) ascii
|
|
|
42 |
<threaded-server> "time-server" >>name 1234 >>insecure [ handle-time-client ] >>handler ; : start-time-server ( -- )
|
|
|
43 |
<time-server> start-server drop ; MAIN: start-time-server </textarea>
|
|
|
44 |
</form>
|
|
|
45 |
<script>
|
|
|
46 |
var editor = CodeMirror.fromTextArea(document.getElementById("code"),
|
|
|
47 |
{
|
|
|
48 |
lineNumbers: true,
|
|
|
49 |
lineWrapping: true,
|
|
|
50 |
indentUnit: 2,
|
|
|
51 |
tabSize: 2,
|
|
|
52 |
autofocus: true,
|
|
|
53 |
mode: "text/x-factor"
|
|
|
54 |
});
|
|
|
55 |
</script>
|
|
|
56 |
<p/>
|
|
|
57 |
<p>Simple mode that handles Factor Syntax (
|
|
|
58 |
<a href="http://en.wikipedia.org/wiki/Factor_(programming_language)">Factor on WikiPedia</a>).</p>
|
|
|
59 |
<p>
|
|
|
60 |
<strong>MIME types defined:</strong> <code>text/x-factor</code>.</p>
|
|
|
61 |
</article>
|