[clike mode] Style Dart class names as variable-2

This commit is contained in:
John Ryan 2019-07-19 13:24:45 -07:00 committed by Marijn Haverbeke
parent 40c3cf2066
commit 85482b0377
1 changed files with 9 additions and 0 deletions

View File

@ -78,6 +78,15 @@
if (!stream.eat("*")) return false
state.tokenize = tokenNestedComment(1)
return state.tokenize(stream, state)
},
token: function(stream, _, style) {
if (style == "variable") {
// Assume uppercase symbols are classes using variable-2
var isUpper = RegExp('^[_$]*[A-Z][a-zA-Z0-9_$]*$','g');
if (isUpper.test(stream.current())) {
return 'variable-2';
}
}
}
}
});