CMIContent Marketing InstituteContent directory

News · General · Archive

CodeMirror: Rust mode

Home News

.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}

CodeMirror

Home Manual Code

Language modes Rust

Rust mode

// Demo code.

type foo = int; enum bar { some(int, foo ), none }

fn check_crate(x: int) { let v = 10; match foo { 1 ... 3 { print_foo(); if x { blah().to_string(); } } (x, y) { "bye" } _ { "hi" } } }

var editor = CodeMirror.fromTextArea(document.getElementById("code"), { lineNumbers: true, lineWrapping: true, indentUnit: 4, mode: "rust" });

MIME types defined: text/x-rustsrc .

More in Archive · More in General · More in News