tools: new tool to extracts function names declared in V files

This commit is contained in:
Delyan Angelov 2019-10-21 14:14:28 +03:00 committed by Alexander Medvednikov
parent cd8b0d04bb
commit eef73eea22
12 changed files with 184 additions and 40 deletions

View file

@ -40,7 +40,6 @@ mut:
import_table FileImportTable // Holds imports for just the file being parsed
pass Pass
os OS
mod string
inside_const bool
expr_var Var
has_immutable_field bool
@ -80,13 +79,10 @@ mut:
sql_params []string // ("select * from users where id = $1", ***"100"***)
sql_types []string // int, string and so on; see sql_params
is_vh bool // parsing .vh file (for example `const (a int)` is allowed)
pub:
mod string
}
const (
EmptyFn = Fn{}
MainFn= Fn{name:'main'}
)
const (
MaxModuleDepth = 4
)
@ -1421,7 +1417,7 @@ fn ($v.name mut $v.typ) $p.cur_fn.name (...) {
if p.assigned_type != p.expected_type {
p.error_with_token_index( 'incompatible types: $p.assigned_type != $p.expected_type', errtok)
}
p.cgen.resetln('memcpy(& $left, $etype{$expr}, sizeof( $left ) );')
p.cgen.resetln('memcpy( (& $left), ($etype{$expr}), sizeof( $left ) );')
}
else if !p.builtin_mod && !p.check_types_no_throw(expr_type, p.assigned_type) {
p.error_with_token_index( 'cannot use type `$expr_type` as type `$p.assigned_type` in assignment', errtok)