mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: remove space in front of ? and ! (#14366)
This commit is contained in:
@@ -6,21 +6,21 @@ from a terminal in an easy and structured manner.
|
||||
The module provides an easy way to prompt the user for
|
||||
questions or even make a REPL or an embedded console.
|
||||
|
||||
|
||||
# Usage:
|
||||
|
||||
```v
|
||||
import readline
|
||||
|
||||
mut r := readline.Readline{}
|
||||
answer := r.read_line('hello: ') ?
|
||||
answer := r.read_line('hello: ')?
|
||||
println(answer)
|
||||
```
|
||||
|
||||
or just:
|
||||
|
||||
```v
|
||||
import readline { read_line }
|
||||
|
||||
input := read_line('What is your name: ') ?
|
||||
input := read_line('What is your name: ')?
|
||||
println('Your name is: $input')
|
||||
```
|
||||
|
@@ -50,7 +50,7 @@ pub fn (mut r Readline) read_line_utf8(prompt string) ?[]rune {
|
||||
// read_line does the same as `read_line_utf8` but returns user input as a `string`.
|
||||
// (As opposed to `[]rune` returned by `read_line_utf8`).
|
||||
pub fn (mut r Readline) read_line(prompt string) ?string {
|
||||
s := r.read_line_utf8(prompt) ?
|
||||
s := r.read_line_utf8(prompt)?
|
||||
return s.string()
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ pub fn (mut r Readline) read_line(prompt string) ?string {
|
||||
// persistent functionalities (e.g. history).
|
||||
pub fn read_line_utf8(prompt string) ?[]rune {
|
||||
mut r := Readline{}
|
||||
s := r.read_line_utf8(prompt) ?
|
||||
s := r.read_line_utf8(prompt)?
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -75,6 +75,6 @@ pub fn read_line_utf8(prompt string) ?[]rune {
|
||||
// persistent functionalities (e.g. history).
|
||||
pub fn read_line(prompt string) ?string {
|
||||
mut r := Readline{}
|
||||
s := r.read_line(prompt) ?
|
||||
s := r.read_line(prompt)?
|
||||
return s
|
||||
}
|
||||
|
@@ -27,6 +27,6 @@ pub fn (mut r Readline) read_line(prompt string) ?string {
|
||||
|
||||
pub fn read_line(prompt string) ?string {
|
||||
mut r := Readline{}
|
||||
s := r.read_line(prompt) ?
|
||||
s := r.read_line(prompt)?
|
||||
return s
|
||||
}
|
||||
|
@@ -169,7 +169,7 @@ pub fn (mut r Readline) read_line_utf8(prompt string) ?[]rune {
|
||||
// read_line does the same as `read_line_utf8` but returns user input as a `string`.
|
||||
// (As opposed to `[]rune` returned by `read_line_utf8`).
|
||||
pub fn (mut r Readline) read_line(prompt string) ?string {
|
||||
s := r.read_line_utf8(prompt) ?
|
||||
s := r.read_line_utf8(prompt)?
|
||||
return s.string()
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ pub fn (mut r Readline) read_line(prompt string) ?string {
|
||||
// persistent functionalities (e.g. history).
|
||||
pub fn read_line_utf8(prompt string) ?[]rune {
|
||||
mut r := Readline{}
|
||||
s := r.read_line_utf8(prompt) ?
|
||||
s := r.read_line_utf8(prompt)?
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ pub fn read_line_utf8(prompt string) ?[]rune {
|
||||
// persistent functionalities (e.g. history).
|
||||
pub fn read_line(prompt string) ?string {
|
||||
mut r := Readline{}
|
||||
s := r.read_line(prompt) ?
|
||||
s := r.read_line(prompt)?
|
||||
return s
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ pub fn (mut r Readline) read_line_utf8(prompt string) ?[]rune {
|
||||
// read_line does the same as `read_line_utf8` but returns user input as a `string`.
|
||||
// (As opposed to `[]rune` returned by `read_line_utf8`).
|
||||
pub fn (mut r Readline) read_line(prompt string) ?string {
|
||||
s := r.read_line_utf8(prompt) ?
|
||||
s := r.read_line_utf8(prompt)?
|
||||
return s.string()
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ pub fn (mut r Readline) read_line(prompt string) ?string {
|
||||
// persistent functionalities (e.g. history).
|
||||
pub fn read_line_utf8(prompt string) ?[]rune {
|
||||
mut r := Readline{}
|
||||
s := r.read_line_utf8(prompt) ?
|
||||
s := r.read_line_utf8(prompt)?
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -73,6 +73,6 @@ pub fn read_line_utf8(prompt string) ?[]rune {
|
||||
// persistent functionalities (e.g. history).
|
||||
pub fn read_line(prompt string) ?string {
|
||||
mut r := Readline{}
|
||||
s := r.read_line(prompt) ?
|
||||
s := r.read_line(prompt)?
|
||||
return s
|
||||
}
|
||||
|
Reference in New Issue
Block a user