Hi all,
I implemented number validation for the bash lexer some time ago, but in
practice, for octals it is impossible to determine whether the user is writing
the characters as a number or as a piece of text. Hence, the splash of red can
be a little irritating, or worse, misleading.
Examples:
# flightgear missing.sh
scriptversion=2004-09-07.08
# git t/t0000/basic.sh
P=087704a96baf1c2d1c869a8b084481e121c88b5b
# openssh config.guess
*:procnto*:*:* | *:QNX:[0123456789]*:*)
So, I suggest that this style be disabled for octals but retained for
radix-prefixed numbers. My question to the list is: Which style should the
red-flagged part be set to, the number style or the default style? The above
are all numbers, in a sense, but just not the numbers that bash is equipped to
deal with, I think.
Test cases for reference:
# Bash number formats
# errors are highlighted when dealing with digits only
0123 0567 # octal good
08 0789 077ABC # octal errors
0xDEAD 0X1234 # hex good
0xABCMNO 0XGHI # hex errors
# extended "[base#]n" format where base is between 2-64
# digits range are [EMAIL PROTECTED]
# if base <= 36, then alphabets are case insensitive
2#10101 # binary
2#23456 # error
8#0123456789AB # error
16#abcDEF123
16#abcpqr # error
[EMAIL PROTECTED] # full base-64
567+0123*0xBCD # with operators
(4#0123-3#012)
Radix-prefixed numbers are sufficiently rare that I think it is unlikely that
something the user do will clash with the format.
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest