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:

committed by
Alexander Medvednikov

parent
c3d0814517
commit
da9b6394e8
@ -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`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user