mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
remove as
casts for basic types
This commit is contained in:
@ -53,6 +53,7 @@ pub fn parse_stmt(text string, table &table.Table) ast.Stmt {
|
||||
mut p := Parser{
|
||||
scanner: s
|
||||
table: table
|
||||
pref: &pref.Preferences{}
|
||||
}
|
||||
p.init_parse_fns()
|
||||
p.read_first_token()
|
||||
|
@ -97,23 +97,26 @@ fn (s mut Scanner) ident_name() string {
|
||||
return name
|
||||
}
|
||||
|
||||
const(
|
||||
num_sep = `_` // char used as number separator
|
||||
const (
|
||||
num_sep = `_` // char used as number separator
|
||||
)
|
||||
|
||||
fn filter_num_sep(txt byteptr, start int, end int) string {
|
||||
mut b := malloc(end-start + 1) // add a byte for the endstring 0
|
||||
mut i := start
|
||||
mut i1 := 0
|
||||
for i < end {
|
||||
if txt[i] != num_sep {
|
||||
b[i1]=txt[i]
|
||||
i1++
|
||||
unsafe{
|
||||
mut b := malloc(end - start + 1) // add a byte for the endstring 0
|
||||
mut i := start
|
||||
mut i1 := 0
|
||||
for i < end {
|
||||
if txt[i] != num_sep {
|
||||
b[i1] = txt[i]
|
||||
i1++
|
||||
}
|
||||
i++
|
||||
}
|
||||
i++
|
||||
b[i1] = 0 // C string compatibility
|
||||
return string{
|
||||
b,i1}
|
||||
}
|
||||
b[i1]=0 // C string compatibility
|
||||
return string{b,i1}
|
||||
}
|
||||
|
||||
fn (s mut Scanner) ident_bin_number() string {
|
||||
|
Reference in New Issue
Block a user