Improved Go highlighting, added builtin types and functions and "range" keyword.
This commit is contained in:
parent
e746383ec0
commit
0dd731a882
1 changed files with 12 additions and 3 deletions
|
|
@ -6,15 +6,24 @@ define(function(require, exports, module) {
|
||||||
var GolangHighlightRules = function() {
|
var GolangHighlightRules = function() {
|
||||||
var keywords = (
|
var keywords = (
|
||||||
"else|break|case|return|goto|if|const|" +
|
"else|break|case|return|goto|if|const|" +
|
||||||
"continue|struct|default|switch|for|" +
|
"continue|struct|default|switch|for|range|" +
|
||||||
"func|import|package|chan|defer|fallthrough|go|interface|map|range" +
|
"func|import|package|chan|defer|fallthrough|go|interface|map|range" +
|
||||||
"select|type|var"
|
"select|type|var"
|
||||||
);
|
);
|
||||||
var buildinConstants = ("nil|true|false|iota");
|
var builtinTypes = (
|
||||||
|
"string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" +
|
||||||
|
"float64|complex64|complex128|byte|rune|uint|int|uintptr"
|
||||||
|
);
|
||||||
|
var builtinFunctions = (
|
||||||
|
"make|close|new"
|
||||||
|
);
|
||||||
|
var builtinConstants = ("nil|true|false|iota");
|
||||||
|
|
||||||
var keywordMapper = this.createKeywordMapper({
|
var keywordMapper = this.createKeywordMapper({
|
||||||
"keyword": keywords,
|
"keyword": keywords,
|
||||||
"constant.language": buildinConstants
|
"constant.language": builtinConstants,
|
||||||
|
"support.function": builtinFunctions,
|
||||||
|
"support.type": builtinTypes
|
||||||
}, "identifier");
|
}, "identifier");
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue