From f1923d454c975f94d0bf61b29dce308a8a506fab Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 7 Oct 2019 01:09:11 +0300 Subject: [PATCH] parser: make verbose mode less verbose --- compiler/parser.v | 7 ++++--- vlib/builtin/string_test.v | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler/parser.v b/compiler/parser.v index a092a551c9..7100052a67 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -1235,9 +1235,9 @@ fn (p mut Parser) statement(add_semi bool) string { switch tok { case .name: next := p.peek() - if p.pref.is_verbose { - println(next.str()) - } + //if p.pref.is_verbose { + //println(next.str()) + //} // goto_label: if p.peek() == .colon { p.fmt_dec() @@ -2760,6 +2760,7 @@ fn (p mut Parser) char_expr() { 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('"', '\\"') $if windows { str = str.replace('\r\n', '\\n') diff --git a/vlib/builtin/string_test.v b/vlib/builtin/string_test.v index c67dd2726f..b2cea663f3 100644 --- a/vlib/builtin/string_test.v +++ b/vlib/builtin/string_test.v @@ -471,3 +471,9 @@ fn test_raw() { assert lines.len == 1 println('raw string: "$raw"') } + +fn test_escape() { + // TODO + //a := 10 + //println("\"$a") +}