diff options
author | Jimmy Zelinskie <jimmyzelinskie@gmail.com> | 2012-09-16 04:57:11 -0400 |
---|---|---|
committer | Jimmy Zelinskie <jimmyzelinskie@gmail.com> | 2012-09-16 04:57:11 -0400 |
commit | 92628028f2c489950c358b803b49235a9f328c5b (patch) | |
tree | 45049db45967131c62dbb939e951dc509311eddc | |
parent | 3aa885ff0956b8a202d72f6e5cc74a4d25f51163 (diff) | |
download | pygments-92628028f2c489950c358b803b49235a9f328c5b.tar.gz |
GoLexer updated for Go1
-rw-r--r-- | pygments/lexers/compiled.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index ffa4081f..8272e64c 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -1822,24 +1822,27 @@ class GoLexer(RegexLexer): (r'//(.*?)\n', Comment.Single), (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), (r'(import|package)\b', Keyword.Namespace), - (r'(var|func|struct|type|interface|const)\b', Keyword.Declaration), - (r'(break|default|select|case|defer|go|map' - r'|chan|else|goto|switch|fallthrough|if|range' + (r'(var|func|struct|map|chan|type|interface|const)\b', Keyword.Declaration), + (r'(break|default|select|case|defer|go' + r'|else|goto|switch|fallthrough|if|range' r'|continue|for|return)\b', Keyword ), + (r'(true|false|iota|nil)\b', Keyword.Constant), # It seems the builtin types aren't actually keywords, but # can be used as functions. So we need two declarations. - (r'(uint8|uint16|uint32|uint64' - r'|int8|int16|int32|int64' - r'|float32|float64|byte|error' - r'|uint|int|float|uintptr' - r'|string|close|closed|len|cap|new|make)\b(\()', bygroups(Name.Builtin, Punctuation) + (r'(uint|uint8|uint16|uint32|uint64' + r'|int|int8|int16|int32|int64' + r'|float|float32|float64' + r'|complex64|complex128|byte|rune' + r'|string|bool|error|uintptr' + r'|print|println|panic|recover|close|complex|real|imag' + r'|len|cap|append|copy|delete|new|make)\b(\()', bygroups(Name.Builtin, Punctuation) ), - (r'(uint8|uint16|uint32|uint64' - r'|int8|int16|int32|int64' - r'|float32|float64|byte|error' - r'|uint|int|float|uintptr' - r'|string)\b', Keyword.Type + (r'(uint|uint8|uint16|uint32|uint64' + r'|int|int8|int16|int32|int64' + r'|float|float32|float64' + r'|complex64|complex128|byte|rune' + r'|string|bool|error|uintptr)\b', Keyword.Type ), # float_lit (r'\d+(\.\d+[eE][+\-]?\d+|' |