Merge pull request #1590 from ajaxorg/go
Improved Go highlighting, added builtin types and functions
This commit is contained in:
commit
5b6a1df596
2 changed files with 19 additions and 10 deletions
|
|
@ -80,10 +80,10 @@
|
|||
["paren.lparen","("],
|
||||
["identifier","n"],
|
||||
["text"," "],
|
||||
["identifier","int"],
|
||||
["support.type","int"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["identifier","float64"],
|
||||
["support.type","float64"],
|
||||
["text"," "],
|
||||
["paren.lparen","{"]
|
||||
],[
|
||||
|
|
@ -94,11 +94,11 @@
|
|||
["punctuation.operator",":"],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["identifier","make"],
|
||||
["support.function","make"],
|
||||
["paren.lparen","("],
|
||||
["keyword","chan"],
|
||||
["text"," "],
|
||||
["identifier","float64"],
|
||||
["support.type","float64"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
["identifier","ch"],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["identifier","float64"],
|
||||
["support.type","float64"],
|
||||
["paren.lparen","("],
|
||||
["identifier","k"],
|
||||
["paren.rparen","))"]
|
||||
|
|
@ -209,12 +209,12 @@
|
|||
["text"," "],
|
||||
["keyword","chan"],
|
||||
["text"," "],
|
||||
["identifier","float64"],
|
||||
["support.type","float64"],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["identifier","k"],
|
||||
["text"," "],
|
||||
["identifier","float64"],
|
||||
["support.type","float64"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["paren.lparen","{"]
|
||||
|
|
|
|||
|
|
@ -6,15 +6,24 @@ define(function(require, exports, module) {
|
|||
var GolangHighlightRules = function() {
|
||||
var keywords = (
|
||||
"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" +
|
||||
"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({
|
||||
"keyword": keywords,
|
||||
"constant.language": buildinConstants
|
||||
"constant.language": builtinConstants,
|
||||
"support.function": builtinFunctions,
|
||||
"support.type": builtinTypes
|
||||
}, "identifier");
|
||||
|
||||
this.$rules = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue