mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
small REPL fixes
This commit is contained in:
parent
f630d3f342
commit
59796a4168
@ -417,7 +417,7 @@ fn (p mut Parser) check_unused_variables() {
|
||||
if var.name == '' {
|
||||
break
|
||||
}
|
||||
if !var.is_used && !var.is_arg && !p.pref.translated && var.name != '_' {
|
||||
if !var.is_used && !p.pref.is_repl && !var.is_arg && !p.pref.translated && var.name != '_' {
|
||||
p.scanner.line_nr = var.line_nr - 1
|
||||
p.error('`$var.name` declared and not used')
|
||||
}
|
||||
|
@ -961,7 +961,6 @@ fn new_v(args[]string) *V {
|
||||
fn run_repl() []string {
|
||||
println('V $Version')
|
||||
println('Use Ctrl-C or `exit` to exit')
|
||||
println('For now you have to use println() to print values, this will be fixed soon\n')
|
||||
file := TmpPath + '/vrepl.v'
|
||||
temp_file := TmpPath + '/vrepl_temp.v'
|
||||
mut lines := []string
|
||||
|
@ -165,8 +165,7 @@ fn (s mut Scanner) cao_change(operator string) {
|
||||
s.text = s.text.substr(0, s.pos - operator.len) + ' = ' + s.get_var_name(s.pos - operator.len) + ' ' + operator + ' ' + s.text.substr(s.pos + 1, s.text.len)
|
||||
}
|
||||
|
||||
fn (s mut Scanner) scan()
|
||||
ScanRes {
|
||||
fn (s mut Scanner) scan() ScanRes {
|
||||
// if s.file_path == 'd.v' {
|
||||
// println('\nscan()')
|
||||
// }
|
||||
|
Loading…
Reference in New Issue
Block a user