mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-29 16:13:27 +03:00
f757c4a512
In UTF-8 locales, the ranges A-F and a-f include several accented
characters beyond "ABCDEF" and "abcdef", such as the Croat č and ć.
This fixes https://savannah.gnu.org/bugs/?61487.
Bug existed since the beginning of each of the syntaxes,
for the C syntax since version 1.3.6, commit 159bdfdc
.
49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
## Syntax highlighting for Go.
|
|
|
|
## Original author: Robert Clausecker
|
|
## License: CC0 (public domain)
|
|
|
|
syntax go "\.go$"
|
|
comment "//"
|
|
|
|
formatter gofmt -w
|
|
|
|
# Types.
|
|
color green "\<(bool|u?int(8|16|32|64)?|float(32|64)|complex(64|128)|byte|rune|uintptr|string|error)\>"
|
|
color green "\<(chan|const|func|interface|map|struct|type|var)\>"
|
|
color green "<-[[:blank:]]*chan\>|\<chan[[:blank:]]*<-"
|
|
|
|
# Predefined functions.
|
|
color blue "\<(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\>"
|
|
|
|
# Control structures.
|
|
color brightyellow "\<(case|default|defer|else|for|go|if|range|select|switch)\>"
|
|
|
|
# Control flow.
|
|
color magenta "\<(break|continue|fallthrough|goto|return)\>"
|
|
|
|
# Declarations.
|
|
color brightcyan "\<(package|import)\>"
|
|
|
|
# Literals.
|
|
color red "\<(true|false|nil|iota|_)\>"
|
|
color red "\<([1-9][0-9]*|0[0-7]*|0[xX][[:xdigit:]]+)\>"
|
|
color red "\<[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?i?\>"
|
|
color red "\<[0-9]+[eE][+-]?[0-9]+i?\>"
|
|
color red "\B\.[0-9]+([eE][+-]?[0-9]+)?i?\>"
|
|
color red "\<[0-9]+i\>"
|
|
|
|
# Strings and characters; slightly fuzzy.
|
|
color red ""([^"\]|\\.)*"|'([^'\]|\\.)+'"
|
|
color red start=""([^"\]|\\.)*\\[[:blank:]]*$" end="^([^"\]|\\.)*""
|
|
|
|
# Comments.
|
|
color brightblue "//.*"
|
|
color brightblue start="/\*" end="\*/"
|
|
|
|
# Special comments.
|
|
color brightcyan "//[[:blank:]]*\+build[[:blank:]]+(([a-zA-Z_0-9]+[[:blank:]]*)+,[[:blank:]]*)*[a-zA-Z_0-9]+"
|
|
|
|
# Trailing whitespace.
|
|
color ,green "[[:space:]]+$"
|