a6d47fe84db98e7804c6d36370c4124dab41d9c7
[myslice.git] / third-party / codemirror-3.15 / mode / rust / index.html
1 <!doctype html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>CodeMirror: Rust mode</title>
6     <link rel="stylesheet" href="../../lib/codemirror.css">
7     <script src="../../lib/codemirror.js"></script>
8     <script src="rust.js"></script>
9     <link rel="stylesheet" href="../../doc/docs.css">
10     <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11   </head>
12   <body>
13     <h1>CodeMirror: Rust mode</h1>
14
15 <div><textarea id="code" name="code">
16 // Demo code.
17
18 type foo<T> = int;
19 enum bar {
20     some(int, foo<float>),
21     none
22 }
23
24 fn check_crate(x: int) {
25     let v = 10;
26     alt foo {
27       1 to 3 {
28         print_foo();
29         if x {
30             blah() + 10;
31         }
32       }
33       (x, y) { "bye" }
34       _ { "hi" }
35     }
36 }
37 </textarea></div>
38
39     <script>
40       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
41         lineNumbers: true,
42         tabMode: "indent"
43       });
44     </script>
45
46     <p><strong>MIME types defined:</strong> <code>text/x-rustsrc</code>.</p>
47   </body>
48 </html>