1. Eric Knibbe
  2. pygments-main

Commits

Jimmy Zelinskie  committed e97df81

GoLexer updated for Go1

  • Participants
  • Parent commits 8802243
  • Branches default

Comments (0)

Files changed (1)

File pygments/lexers/compiled.py

View file
             (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+|'