syntax: go: highlight also floats with leading zeroes as valid

See the discussion on the mailing list:
https://lists.gnu.org/archive/html/nano-devel/2018-01/msg00022.html
https://lists.gnu.org/archive/html/nano-devel/2018-02/msg00090.html

Signed-off-by: Tom Levy <tomlevy93@gmail.com>
master
Tom Levy 2018-01-08 06:31:58 +00:00 committed by Benno Schulenberg
parent dd9766c2e0
commit fef195bce9
1 changed files with 5 additions and 3 deletions

View File

@ -24,9 +24,11 @@ color brightcyan "\<(package|import)\>"
color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
# Literals.
color red "\<0([0-7]*|[xX][0-9a-fA-F]+)\>"
color red "(\<0+|\B)\.[0-9]+([Ee][+-]?[0-9]+)?i?\>"
color red "\<[1-9][0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?i?\>"
color red "\<([1-9][0-9]*|0[0-7]*|0[xX][0-9A-Fa-f]+)\>"
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 "\<(true|false|nil|iota|_)\>"