ci: run vfmt over checker.v and types.v

pull/7844/head
Delyan Angelov 2021-01-03 19:02:33 +02:00
parent c84d1841ea
commit 745a7f8d8f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 9 additions and 4 deletions

View File

@ -26,7 +26,8 @@ const (
valid_comp_if_compilers = ['gcc', 'tinyc', 'clang', 'mingw', 'msvc', 'cplusplus']
valid_comp_if_platforms = ['amd64', 'aarch64', 'x64', 'x32', 'little_endian', 'big_endian']
valid_comp_if_other = ['js', 'debug', 'test', 'glibc', 'prealloc', 'no_bounds_checking']
array_builtin_methods = ['filter', 'clone', 'repeat', 'reverse', 'map', 'slice', 'sort', 'contains', 'index']
array_builtin_methods = ['filter', 'clone', 'repeat', 'reverse', 'map', 'slice', 'sort',
'contains', 'index']
)
pub struct Checker {
@ -1205,8 +1206,7 @@ pub fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type {
}
// TODO: remove this for actual methods, use only for compiler magic
// FIXME: Argument count != 1 will break these
if left_type_sym.kind == .array &&
method_name in array_builtin_methods {
if left_type_sym.kind == .array && method_name in array_builtin_methods {
mut elem_typ := table.void_type
is_filter_map := method_name in ['filter', 'map']
is_sort := method_name == 'sort'

View File

@ -517,7 +517,12 @@ pub fn (mut t Table) register_builtin_type_symbols() {
t.register_type_symbol(kind: .chan, name: 'chan', cname: 'chan', mod: 'builtin')
t.register_type_symbol(kind: .size_t, name: 'size_t', cname: 'size_t', mod: 'builtin')
t.register_type_symbol(kind: .any, name: 'any', cname: 'any', mod: 'builtin')
t.register_type_symbol(kind: .any_float, name: 'untyped float', cname: 'any_float', mod: 'builtin')
t.register_type_symbol(
kind: .any_float
name: 'untyped float'
cname: 'any_float'
mod: 'builtin'
)
t.register_type_symbol(kind: .any_int, name: 'untyped int', cname: 'any_int', mod: 'builtin')
}