mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: error on an unknown ident
This commit is contained in:
parent
a25f47124d
commit
1d52847924
@ -683,7 +683,7 @@ pub fn get_raw_line() string {
|
||||
} $else {
|
||||
max := size_t(0)
|
||||
mut buf := charptr(0)
|
||||
nr_chars := C.getline(&buf, &max, stdin)
|
||||
nr_chars := C.getline(&buf, &max, C.stdin)
|
||||
//defer { unsafe{ free(buf) } }
|
||||
if nr_chars == 0 || nr_chars == -1 {
|
||||
return ''
|
||||
@ -1118,7 +1118,7 @@ pub fn flush_stdout() {
|
||||
}
|
||||
|
||||
pub fn flush() {
|
||||
C.fflush(stdout)
|
||||
C.fflush(C.stdout)
|
||||
}
|
||||
|
||||
pub fn mkdir_all(path string) {
|
||||
|
@ -944,11 +944,13 @@ pub fn (c mut Checker) ident(ident mut ast.Ident) table.Type {
|
||||
return fn_type
|
||||
}
|
||||
}
|
||||
// TODO
|
||||
// c.error('unknown ident: `$ident.name`', ident.pos)
|
||||
if ident.is_c {
|
||||
return table.int_type
|
||||
}
|
||||
// TODO
|
||||
if ident.name != '_' {
|
||||
c.error('unknown ident: `$ident.name`', ident.pos)
|
||||
}
|
||||
return table.void_type
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user