syntax: go: colorize only valid octal numbers

Reported-by: Tom Levy <tomlevy93@gmail.com>
master
Benno Schulenberg 2018-01-04 21:24:23 +01:00
parent 97cbbb0cc8
commit 452008c81d
1 changed files with 3 additions and 3 deletions

View File

@ -24,9 +24,9 @@ color brightcyan "\<(package|import)\>"
color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+" color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
# Literals. # Literals.
color red "\<[0-9]+(\.[0-9]*)?([Ee][+-]?[0-9]+)?i?\>" color red "\<0([0-7]*|[xX][0-9a-fA-F]+)\>"
color red "\B\.[0-9]+([Ee][+-]?[0-9]+)?i?\>" color red "(\<0+|\B)\.[0-9]+([Ee][+-]?[0-9]+)?i?\>"
color red "\<(0[0-7]*|[1-9][0-9]*|0[xX][0-9a-fA-F]+)\>" color red "\<[1-9][0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?i?\>"
# Strings and characters; slightly fuzzy. # Strings and characters; slightly fuzzy.
color red "\<(true|false|nil|iota|_)\>" color red "\<(true|false|nil|iota|_)\>"