diff --git a/lib/ace/mode/_test/tokens_golang.json b/lib/ace/mode/_test/tokens_golang.json index 4257369b..070c0a17 100644 --- a/lib/ace/mode/_test/tokens_golang.json +++ b/lib/ace/mode/_test/tokens_golang.json @@ -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","{"] diff --git a/lib/ace/mode/golang_highlight_rules.js b/lib/ace/mode/golang_highlight_rules.js index b323e9e4..76b6141e 100644 --- a/lib/ace/mode/golang_highlight_rules.js +++ b/lib/ace/mode/golang_highlight_rules.js @@ -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 = {