comparison .cms/lib/codemirror/mode/rust/test.js @ 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 // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 // Distributed under an MIT license: https://codemirror.net/5/LICENSE
3
4 (function() {
5 var mode = CodeMirror.getMode({indentUnit: 4}, "rust");
6 function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));}
7
8 MT('integer_test',
9 '[number 123i32]',
10 '[number 123u32]',
11 '[number 123_u32]',
12 '[number 0xff_u8]',
13 '[number 0o70_i16]',
14 '[number 0b1111_1111_1001_0000_i32]',
15 '[number 0usize]');
16
17 MT('float_test',
18 '[number 123.0f64]',
19 '[number 0.1f64]',
20 '[number 0.1f32]',
21 '[number 12E+99_f64]');
22
23 MT('string-literals-test',
24 '[string "foo"]',
25 '[string r"foo"]',
26 '[string "\\"foo\\""]',
27 '[string r#""foo""#]',
28 '[string "foo #\\"# bar"]',
29
30 '[string b"foo"]',
31 '[string br"foo"]',
32 '[string b"\\"foo\\""]',
33 '[string br#""foo""#]',
34 '[string br##"foo #" bar"##]',
35
36 "[string-2 'h']",
37 "[string-2 b'h']");
38
39 })();