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

0bxxxx binary literal support; _ in literals (1_000_000)

This commit is contained in:
penguindark
2020-01-23 03:28:25 +01:00
committed by Alexander Medvednikov
parent c3d0814517
commit da9b6394e8
5 changed files with 112 additions and 14 deletions

View File

@ -220,6 +220,7 @@ fn (s string) at(idx int) byte {
}
return s.str[idx]
}
pub fn (c byte) is_digit() bool {
return c >= `0` && c <= `9`
}
@ -232,6 +233,10 @@ pub fn (c byte) is_oct_digit() bool {
return c >= `0` && c <= `7`
}
pub fn (c byte) is_bin_digit() bool {
return c == `0` || c == `1`
}
pub fn (c byte) is_letter() bool {
return (c >= `a` && c <= `z`) || (c >= `A` && c <= `Z`)
}