cmd/v: fix `run`
parent
b7560fe4bf
commit
33644a4f91
|
@ -47,8 +47,8 @@ fn main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
prefs, command := parse_args(args)
|
prefs, command := parse_args(args)
|
||||||
//println('main() command = $command')
|
|
||||||
if prefs.is_verbose {
|
if prefs.is_verbose {
|
||||||
|
println('command = "$command"')
|
||||||
println(util.full_v_version())
|
println(util.full_v_version())
|
||||||
}
|
}
|
||||||
if prefs.is_verbose {
|
if prefs.is_verbose {
|
||||||
|
@ -168,6 +168,12 @@ fn parse_args(args []string) (&pref.Preferences, string) {
|
||||||
if command.ends_with('.v') || os.exists(command) {
|
if command.ends_with('.v') || os.exists(command) {
|
||||||
res.path = command
|
res.path = command
|
||||||
}
|
}
|
||||||
|
else if command == 'run' {
|
||||||
|
res.path = args[args.len-1]
|
||||||
|
}
|
||||||
|
if res.is_verbose {
|
||||||
|
println('setting pref.path to "$res.path"')
|
||||||
|
}
|
||||||
res.fill_with_defaults()
|
res.fill_with_defaults()
|
||||||
return res, command
|
return res, command
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ fn (p mut Parser) fn_decl() ast.FnDecl {
|
||||||
p.error('function names cannot contain uppercase letters, use snake_case instead')
|
p.error('function names cannot contain uppercase letters, use snake_case instead')
|
||||||
}
|
}
|
||||||
if is_method && p.table.get_type_symbol(rec_type).has_method(name) {
|
if is_method && p.table.get_type_symbol(rec_type).has_method(name) {
|
||||||
p.warn('duplicate method `$name`')
|
p.error('duplicate method `$name`')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if p.tok.kind in [.plus, .minus, .mul, .div, .mod] {
|
if p.tok.kind in [.plus, .minus, .mul, .div, .mod] {
|
||||||
|
|
Loading…
Reference in New Issue