Skip to content

Commit 2018cd9

Browse files
committed
Update keywords in codemirror-rust.js
1 parent 7852529 commit 2018cd9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/lib/codemirror-rust.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ CodeMirror.defineMode("rust", function() {
22
var indentUnit = 4, altIndentUnit = 2;
33
var valKeywords = {
44
"if": "if-style", "while": "if-style", "loop": "if-style", "else": "else-style",
5-
"do": "else-style", "ret": "else-style", "fail": "else-style",
5+
"do": "else-style", "return": "else-style", "fail": "else-style",
66
"break": "atom", "cont": "atom", "const": "let", "resource": "fn",
7-
"let": "let", "fn": "fn", "for": "for", "alt": "alt", "trait": "trait",
7+
"let": "let", "fn": "fn", "for": "for", "match": "match", "trait": "trait",
88
"impl": "impl", "type": "type", "enum": "enum", "class": "atom", "mod": "mod",
99
"as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op",
1010
"claim": "op", "extern": "ignore", "unsafe": "ignore", "import": "else-style",
11-
"export": "else-style", "copy": "op", "log": "op", "log_err": "op",
12-
"use": "op", "bind": "op", "self": "atom", "new": "atom"
11+
"export": "else-style", "copy": "op", "log": "op",
12+
"use": "op", "self": "atom"
1313
};
1414
var typeKeywords = function() {
1515
var keywords = {"fn": "fn"};
@@ -197,7 +197,7 @@ CodeMirror.defineMode("rust", function() {
197197
if (type == "if-style") return cont(expression, expression);
198198
if (type == "else-style" || type == "op") return cont(expression);
199199
if (type == "for") return cont(pattern, maybetype, inop, expression, expression);
200-
if (type == "alt") return cont(expression, altbody);
200+
if (type == "match") return cont(expression, altbody);
201201
if (type == "fn") return cont(fndef);
202202
if (type == "macro") return cont(macro);
203203
return cont();
@@ -346,7 +346,7 @@ CodeMirror.defineMode("rust", function() {
346346
else return pass();
347347
}
348348
function altbody(type) {
349-
if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex);
349+
if (type == "{") return cont(pushlex("}", "match"), altblock1, poplex);
350350
return pass();
351351
}
352352
function altblock1(type) {
@@ -357,7 +357,7 @@ CodeMirror.defineMode("rust", function() {
357357
return pass(pattern, altblock2);
358358
}
359359
function altblock2(type) {
360-
if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1);
360+
if (type == "{") return cont(pushlex("}", "match"), block, poplex, altblock1);
361361
else return pass(altblock1);
362362
}
363363

@@ -422,7 +422,7 @@ CodeMirror.defineMode("rust", function() {
422422
type = lexical.type, closing = firstChar == type;
423423
if (type == "stat") return lexical.indented + indentUnit;
424424
if (lexical.align) return lexical.column + (closing ? 0 : 1);
425-
return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit));
425+
return lexical.indented + (closing ? 0 : (lexical.info == "match" ? altIndentUnit : indentUnit));
426426
},
427427

428428
electricChars: "{}"

0 commit comments

Comments
 (0)