bcc
bcc copied to clipboard
IsAlpha() contains a-zA-z but not underscore
While BMK has CharIsAlpha()
in "bmk_config.bmx" which includes "_" (underscore) and a-zA-Z its counterpart in BCC doesn't.
Within the BCC code there is a single instance which utilizes that "IsAlpha()" does not include the underscore:
If IsAlpha(TCHR(sym.length-1)) Or IsDigit(TCHR(sym.length-1)) Then
(toker.bmx:284)
I think it is a bit inconsistent to include underscore in BMK but not in BCC (so similar to the "\w" regex code) or vice versa (consistent but not regex like).
Above's code line could of course then become If IsAlphaNum(TCHR(sym.length-1)) and not TCHR(sym.length-1) = asc("_") Then
to still avoid tokens ending with underscore. Yes, IsAlphaNum
needs to get added too. In other spots of the code you could then replace the checks for "isAlpha() and is underscore" with a simple "isAlpha()".
Even Better (but "longer" named) is a complete "IsWordCharacter()" thing if you want "a-zA-Z0-9_". That way it would be clear that you do not just include "alpha" and "numeric" but something more.
Minor I know :)