1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.scanner: fix ambiguity of two-level generics and shift-right (#11540)

This commit is contained in:
Ruofan XU
2021-09-19 21:22:28 +08:00
committed by GitHub
parent 76f70d51f3
commit b343f19bec
4 changed files with 108 additions and 7 deletions

View File

@@ -1274,6 +1274,13 @@ pub fn (c byte) is_letter() bool {
return (c >= `a` && c <= `z`) || (c >= `A` && c <= `Z`)
}
// is_alnum returns `true` if the byte is in range a-z, A-Z, 0-9 and `false` otherwise.
// Example: assert byte(`V`) == true
[inline]
pub fn (c byte) is_alnum() bool {
return c.is_letter() || c.is_digit()
}
// free allows for manually freeing the memory occupied by the string
[manualfree; unsafe]
pub fn (s &string) free() {