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

Revert "repl: readline line editing "

This reverts commit 1956c6f906.
This commit is contained in:
Alexander Medvednikov
2019-10-16 03:31:48 +03:00
parent 00fd1abf82
commit 66f36be7d0
5 changed files with 13 additions and 92 deletions

View File

@@ -4,11 +4,8 @@
module compiler
import (
os
term
readline
)
import os
import term
struct Repl {
mut:
@@ -84,27 +81,22 @@ pub fn run_repl() []string {
os.rm(temp_file.left(temp_file.len - 2))
}
mut r := Repl{}
mut readline := readline.Readline{}
vexe := os.args[0]
mut prompt := '>>> '
for {
if r.indent == 0 {
prompt = '>>> '
print('>>> ')
}
else {
prompt = '... '
print('... ')
}
mut line := readline.read_line(prompt) or {
break
}
if line.trim_space() == '' && line.ends_with('\n') {
r.line = os.get_raw_line()
if r.line.trim_space() == '' && r.line.ends_with('\n') {
continue
}
line = line.trim_space()
if line.len <= -1 || line == '' || line == 'exit' {
r.line = r.line.trim_space()
if r.line.len == -1 || r.line == '' || r.line == 'exit' {
break
}
r.line = line
if r.line == '\n' {
continue
}