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

parser: make verbose mode less verbose

This commit is contained in:
Alexander Medvednikov 2019-10-07 01:09:11 +03:00
parent fdef2b0f8b
commit f1923d454c
2 changed files with 10 additions and 3 deletions

View File

@ -1235,9 +1235,9 @@ fn (p mut Parser) statement(add_semi bool) string {
switch tok { switch tok {
case .name: case .name:
next := p.peek() next := p.peek()
if p.pref.is_verbose { //if p.pref.is_verbose {
println(next.str()) //println(next.str())
} //}
// goto_label: // goto_label:
if p.peek() == .colon { if p.peek() == .colon {
p.fmt_dec() p.fmt_dec()
@ -2760,6 +2760,7 @@ fn (p mut Parser) char_expr() {
fn format_str(_str string) string { fn format_str(_str string) string {
// TODO don't call replace 3 times for every string, do this in scanner.v
mut str := _str.replace('"', '\\"') mut str := _str.replace('"', '\\"')
$if windows { $if windows {
str = str.replace('\r\n', '\\n') str = str.replace('\r\n', '\\n')

View File

@ -471,3 +471,9 @@ fn test_raw() {
assert lines.len == 1 assert lines.len == 1
println('raw string: "$raw"') println('raw string: "$raw"')
} }
fn test_escape() {
// TODO
//a := 10
//println("\"$a")
}