1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: minor fixes

This commit is contained in:
Alexander Medvednikov 2020-03-20 17:20:53 +01:00
parent 6b571155f4
commit 5a7f683f61
3 changed files with 5 additions and 4 deletions

View File

@ -16,7 +16,8 @@ pub fn parse_pref(args []string, callback fn(string, &Instance, &pref.Preference
args: args args: args
current_pos: 0 current_pos: 0
} }
tmp := p.parse_impl(args, voidptr(obj), void_cb(callback)) or { //tmp := p.parse_impl(args, voidptr(obj), void_cb(callback)) or {
tmp := p.parse_impl(args, obj, void_cb(callback)) or {
return error(err) return error(err)
} }
return tmp return tmp
@ -40,7 +41,7 @@ pub fn parse_main_cmd(args []string, callback fn(string, &Instance, &MainCmdPref
args: args args: args
current_pos: 0 current_pos: 0
} }
tmp := p.parse_impl(args, voidptr(obj), void_cb(callback)) or { tmp := p.parse_impl(args, obj, void_cb(callback)) or {
return error(err) return error(err)
} }
return tmp return tmp

View File

@ -26,7 +26,7 @@ const (
fn main() { fn main() {
prefs := flag.MainCmdPreferences{} prefs := flag.MainCmdPreferences{}
values := flag.parse_main_cmd(os.args, parse_flags, &prefs) or { values := flag.parse_main_cmd(os.args, parse_flags, prefs) or {
println('V Error: An error has occurred while parsing flags: ') println('V Error: An error has occurred while parsing flags: ')
println(err) println(err)
exit(1) exit(1)

View File

@ -346,7 +346,7 @@ fn (p mut Parser) fn_decl() {
if p.tok == .lt { if p.tok == .lt {
// instance (dispatch) // instance (dispatch)
if p.generic_dispatch.inst.size > 0 { if p.generic_dispatch.inst.size > 0 {
rename_generic_fn_instance(mut f, &p.generic_dispatch) rename_generic_fn_instance(mut f, p.generic_dispatch)
} }
else { else {
f.is_generic = true f.is_generic = true