comparison .cms/lib/codemirror/mode/rust/index.html @ 0:78edf6b517a0 draft

24.10
author Coffee CMS <info@coffee-cms.ru>
date Fri, 11 Oct 2024 22:40:23 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:78edf6b517a0
1 <!doctype html>
2
3 <title>CodeMirror: Rust mode</title>
4 <meta charset="utf-8"/>
5 <link rel=stylesheet href="../../doc/docs.css">
6
7 <link rel="stylesheet" href="../../lib/codemirror.css">
8 <script src="../../lib/codemirror.js"></script>
9 <script src="../../addon/mode/simple.js"></script>
10 <script src="rust.js"></script>
11 <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
12 <div id=nav>
13 <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
14
15 <ul>
16 <li><a href="../../index.html">Home</a>
17 <li><a href="../../doc/manual.html">Manual</a>
18 <li><a href="https://github.com/codemirror/codemirror5">Code</a>
19 </ul>
20 <ul>
21 <li><a href="../index.html">Language modes</a>
22 <li><a class=active href="#">Rust</a>
23 </ul>
24 </div>
25
26 <article>
27 <h2>Rust mode</h2>
28
29
30 <div><textarea id="code" name="code">
31 // Demo code.
32
33 type foo<T> = i32;
34 enum bar {
35 Some(i32, foo<f32>),
36 None
37 }
38
39 fn check_crate(x: i32) {
40 let v = 10;
41 match foo {
42 1 ... 3 {
43 print_foo();
44 if x {
45 blah().to_string();
46 }
47 }
48 (x, y) { "bye" }
49 _ { "hi" }
50 }
51 }
52 </textarea></div>
53
54 <script>
55 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
56 lineNumbers: true,
57 lineWrapping: true,
58 indentUnit: 4,
59 mode: "rust"
60 });
61 </script>
62
63 <p><strong>MIME types defined:</strong> <code>text/x-rustsrc</code>.</p>
64 </article>