Defined color mappings for Go

master
Aadhavan Srinivasan 4 months ago
parent 373c3c3385
commit 66b227fb63

@ -0,0 +1,30 @@
# Priority decreases going downward ie. If two regexes match the same piece of
# text, the one defined earlier will take precedence over the one defined later.
# Comments
'//.*': GRAY
'/\*[^*]*\*+(?:[^/*][^*]*\*+)*/': GRAY
# Numbers and special values
'\b\-?[0-9]*\b': MAGENTA
'\b(true|false)\b': MAGENTA
'\b(nil)\b': MAGENTA
# Strings in double quotes and backticks
'"(.*?)"': BLUE
'`(.*?)`': BLUE
# Bytes / Runes
"'(.)'": BLUE
"'\\\\(.)'": BLUE # The escape backslash needs to be escaped as well
# Assignments and comparisons
'(?:\s|\b)(=|==|!=|<=|>=)(\s|\b)' : CYAN
'(&&)|(\|\|)': CYAN
# Keywords
'\b(if|else|for|range|go|func|return|break|continue)\b': CYAN
'\b(import|var|const|type|struct)\b': CYAN
# Built-in Functions
'\b(panic|len)\b': DARKBLUE
# Functions from packages (package name and function name separated by dot)
'\b(\w*\.\w*)\b': DARKBLUE
# Data Types
'\b(bool|byte|rune|string|interface|map|chan)\b': YELLOW
'\b(u?int)(8|16|32|64)?\b': YELLOW
'\b(float)(32|64)\b': YELLOW
'\b(complex)(64|128)\b': YELLOW
Loading…
Cancel
Save