diff --git a/cmd/tools/gen_vc.v b/cmd/tools/gen_vc.v index 9d1e045402..7428bb433d 100644 --- a/cmd/tools/gen_vc.v +++ b/cmd/tools/gen_vc.v @@ -169,10 +169,10 @@ pub fn (mut ws WebhookServer) genhook() { ws.gen_vc.generate() // error in generate if ws.gen_vc.gen_error { - ws.json('{ status: "failed" }') + ws.json('{status: "failed"}') return } - ws.json('{ status: "ok" }') + ws.json('{status: "ok"}') } pub fn (ws &WebhookServer) reset() { diff --git a/cmd/tools/modules/vgit/vgit.v b/cmd/tools/modules/vgit/vgit.v index 4f3b32425a..e85c743d3d 100644 --- a/cmd/tools/modules/vgit/vgit.v +++ b/cmd/tools/modules/vgit/vgit.v @@ -112,10 +112,10 @@ pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() { mut command_for_selfbuilding := '' if 'windows' == os.user_os() { command_for_building_v_from_c_source = '$vgit_context.cc -std=c99 -I ./thirdparty/stdatomic/win -municode -w -o cv.exe "$vgit_context.path_vc/v_win.c" ' - command_for_selfbuilding = './cv.exe -o $vgit_context.vexename \{SOURCE}' + command_for_selfbuilding = './cv.exe -o $vgit_context.vexename {SOURCE}' } else { command_for_building_v_from_c_source = '$vgit_context.cc -std=gnu11 -I ./thirdparty/stdatomic/nix -w -o cv "$vgit_context.path_vc/v.c" -lm -lpthread' - command_for_selfbuilding = './cv -o $vgit_context.vexename \{SOURCE}' + command_for_selfbuilding = './cv -o $vgit_context.vexename {SOURCE}' } scripting.chdir(vgit_context.workdir) clone_or_pull(vgit_context.v_repo_url, vgit_context.path_v) @@ -146,7 +146,7 @@ pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() { scripting.run('make fresh_tcc') } scripting.run(command_for_building_v_from_c_source) - build_cmd := command_for_selfbuilding.replace('\{SOURCE}', vgit_context.vvlocation) + build_cmd := command_for_selfbuilding.replace('{SOURCE}', vgit_context.vvlocation) scripting.run(build_cmd) // At this point, there exists a file vgit_context.vexepath // which should be a valid working V executable. diff --git a/cmd/tools/repeat.v b/cmd/tools/repeat.v index 16ca9e9805..6e0571a2dd 100644 --- a/cmd/tools/repeat.v +++ b/cmd/tools/repeat.v @@ -165,8 +165,8 @@ fn (mut context Context) parse_options() ! { context.verbose = fp.bool('verbose', `v`, false, 'Be more verbose.') context.fail_on_maxtime = fp.int('max_time', `m`, max_time, 'Fail with exit code 2, when first cmd takes above M milliseconds (regression).') context.fail_on_regress_percent = fp.int('fail_percent', `f`, max_fail_percent, 'Fail with exit code 3, when first cmd is X% slower than the rest (regression).') - context.cmd_template = fp.string('template', `t`, r'{T}', r'Command template. {T} will be substituted with the current command.') - cmd_params := fp.string_multi('parameter', `p`, r'A parameter substitution list. `{p}=val1,val2,val2` means that {p} in the template, will be substituted with each of val1, val2, val3.') + context.cmd_template = fp.string('template', `t`, '{T}', 'Command template. {T} will be substituted with the current command.') + cmd_params := fp.string_multi('parameter', `p`, 'A parameter substitution list. `{p}=val1,val2,val2` means that {p} in the template, will be substituted with each of val1, val2, val3.') context.nmins = fp.int('nmins', `i`, 0, 'Ignore the BOTTOM X results (minimum execution time). Makes the results more robust to performance flukes.') context.nmaxs = fp.int('nmaxs', `a`, 1, 'Ignore the TOP X results (maximum execution time). Makes the results more robust to performance flukes.') for p in cmd_params { @@ -212,7 +212,7 @@ fn (mut context Context) clear_line() { fn (mut context Context) expand_all_commands(commands []string) []string { mut all_commands := []string{} for cmd in commands { - maincmd := context.cmd_template.replace(r'{T}', cmd) + maincmd := context.cmd_template.replace('{T}', cmd) mut substituted_commands := []string{} substituted_commands << maincmd for paramk, paramlist in context.cmd_params { diff --git a/cmd/tools/vbug.v b/cmd/tools/vbug.v index 363a40ce63..f5cd708452 100644 --- a/cmd/tools/vbug.v +++ b/cmd/tools/vbug.v @@ -141,7 +141,7 @@ $vdoctor_output **What did you do?** `v -g -o vdbg cmd/v && vdbg $file_path` -\{file_content} +{file_content} **What did you expect to see?** @@ -150,11 +150,11 @@ $expected_result **What did you see instead?** ``` $build_output```' - mut encoded_body := urllib.query_escape(raw_body.replace_once(r'{file_content}', '```v\n$file_content\n```')) + mut encoded_body := urllib.query_escape(raw_body.replace_once('{file_content}', '```v\n$file_content\n```')) mut generated_uri := 'https://github.com/vlang/v/issues/new?labels=Bug&body=$encoded_body' if generated_uri.len > 8192 { // GitHub doesn't support URLs longer than 8192 characters - encoded_body = urllib.query_escape(raw_body.replace_once(r'{file_content}', 'See attached file `$file_path`')) + encoded_body = urllib.query_escape(raw_body.replace_once('{file_content}', 'See attached file `$file_path`')) generated_uri = 'https://github.com/vlang/v/issues/new?labels=Bug&body=$encoded_body' println('Your file is too big to be submitted. Head over to the following URL and attach your file.') println(generated_uri) diff --git a/cmd/tools/vdoctor.v b/cmd/tools/vdoctor.v index 64ae8acaa6..f5243fa40b 100644 --- a/cmd/tools/vdoctor.v +++ b/cmd/tools/vdoctor.v @@ -72,7 +72,7 @@ fn (mut a App) collect_info() { os_details += ' (WSL)' } // From https://unix.stackexchange.com/a/14346 - awk_cmd := '[ "$(awk \'\$5=="/" { print \$1 }\' ' 'lt': '<' @@ -46,7 +46,7 @@ fn main() { for lt2 in literal_types { b.write_string('$lt2{return left.val${op}right}') } - b.write_string("else{ e.error('invalid operands to $op: $ct and \$right.type_name()')}}}") + b.write_string("else{e.error('invalid operands to $op: $ct and \$right.type_name()')}}}") } for lt in literal_types { b.write_string('$lt {match right{') @@ -61,9 +61,9 @@ fn main() { b.write_string(" literal and \$right.type_name()')}}}") } if op in ['==', '!='] { - b.write_string('string{ match right{ string{ return left${op}right}else{ e.error(\'invalid operands to $op: string and \$right.type_name()\')}}}') + b.write_string('string{match right{string{return left${op}right}else{e.error(\'invalid operands to $op: string and \$right.type_name()\')}}}') } - b.write_string("else { e.error('invalid operands to $op: \$left.type_name() and \$right.type_name()')}}}") + b.write_string("else {e.error('invalid operands to $op: \$left.type_name() and \$right.type_name()')}}}") } for math, op in math_ops { b.write_string('.$math{match left{') @@ -77,9 +77,9 @@ fn main() { continue } unsafe_start, unsafe_end := if op in ['<<', '>>'] { 'unsafe{', '}' } else { '', '' } - b.write_string('$ct2{ if expecting in ast.signed_integer_type_idxs{ return Int{ i64(left.val)${op}i64(right.val),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{ return Uint{ u64(left.val)${op}u64(right.val),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left.val)${op}i64(right.val))$unsafe_end}') + b.write_string('$ct2{if expecting in ast.signed_integer_type_idxs{return Int{i64(left.val)${op}i64(right.val),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{return Uint{u64(left.val)${op}u64(right.val),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left.val)${op}i64(right.val))$unsafe_end}') if op !in ['<<', '>>'] { - b.write_string('else if expecting in ast.float_type_idxs{ return Float{ f64(left.val)${op}f64(right.val),i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{ return f64(f64(left.val)${op}f64(right.val))}') + b.write_string('else if expecting in ast.float_type_idxs{return Float{f64(left.val)${op}f64(right.val), i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{return f64(f64(left.val)${op}f64(right.val))}') } b.write_string(uk_expect_footer) } @@ -88,13 +88,13 @@ fn main() { continue } unsafe_start, unsafe_end := if op in ['<<', '>>'] { 'unsafe{', '}' } else { '', '' } - b.write_string('$lt2{ if expecting in ast.signed_integer_type_idxs{ return Int{ i64(left.val)${op}i64(right),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{ return Uint{ u64(left.val)${op}u64(right),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left.val)${op}i64(right))$unsafe_end}') + b.write_string('$lt2{if expecting in ast.signed_integer_type_idxs{return Int{i64(left.val)${op}i64(right),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{return Uint{u64(left.val)${op}u64(right),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left.val)${op}i64(right))$unsafe_end}') if op !in ['<<', '>>'] { - b.write_string('else if expecting in ast.float_type_idxs{ return Float{ f64(left.val)${op}f64(right), i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{ return f64(f64(left.val)${op}f64(right))}') + b.write_string('else if expecting in ast.float_type_idxs{return Float{f64(left.val)${op}f64(right), i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{return f64(f64(left.val)${op}f64(right))}') } b.write_string(uk_expect_footer) } - b.write_string("else { e.error('invalid operands to $op: $ct and \$right.type_name()')}}}") + b.write_string("else {e.error('invalid operands to $op: $ct and \$right.type_name()')}}}") } for lt in literal_types { if op in ['<<', '>>'] && lt == 'f64' { @@ -106,9 +106,9 @@ fn main() { continue } unsafe_start, unsafe_end := if op in ['<<', '>>'] { 'unsafe{', '}' } else { '', '' } - b.write_string('$ct2{ if expecting in ast.signed_integer_type_idxs{ return Int{ i64(left)${op}i64(right.val),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{ return Uint{ u64(left)${op}u64(right.val),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left)${op}i64(right.val))$unsafe_end}') + b.write_string('$ct2{if expecting in ast.signed_integer_type_idxs{return Int{i64(left)${op}i64(right.val),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{return Uint{u64(left)${op}u64(right.val),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left)${op}i64(right.val))$unsafe_end}') if op !in ['<<', '>>'] { - b.write_string('else if expecting in ast.float_type_idxs{ return Float{ f64(left)${op}f64(right.val), i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{ return f64(f64(left)${op}f64(right.val))}') + b.write_string('else if expecting in ast.float_type_idxs{return Float{f64(left)${op}f64(right.val), i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{return f64(f64(left)${op}f64(right.val))}') } b.write_string(uk_expect_footer) } @@ -117,9 +117,9 @@ fn main() { continue } unsafe_start, unsafe_end := if op in ['<<', '>>'] { 'unsafe{', '}' } else { '', '' } - b.write_string('$lt2{if expecting in ast.signed_integer_type_idxs{ return Int{ i64(left)${op}i64(right),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{ return Uint{ u64(left)${op}u64(right),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left)${op}i64(right))$unsafe_end}') + b.write_string('$lt2{if expecting in ast.signed_integer_type_idxs{return Int{i64(left)${op}i64(right),i8(e.type_to_size(expecting))}}else if expecting in ast.unsigned_integer_type_idxs{return Uint{u64(left)${op}u64(right),i8(e.type_to_size(expecting))}}else if expecting==ast.int_literal_type_idx{${unsafe_start}return i64(i64(left)${op}i64(right))$unsafe_end}') if op !in ['<<', '>>'] { - b.write_string('else if expecting in ast.float_type_idxs{ return Float{ f64(left)${op}f64(right), i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{ return f64(f64(left)${op}f64(right))}') + b.write_string('else if expecting in ast.float_type_idxs{return Float{f64(left)${op}f64(right), i8(e.type_to_size(expecting))}}else if expecting==ast.float_literal_type_idx{return f64(f64(left)${op}f64(right))}') } b.write_string(uk_expect_footer) } @@ -127,7 +127,7 @@ fn main() { b.write_string(if lt == 'i64' { 'int' } else { 'float' }) b.write_string(" literal and \$right.type_name()')}}}") } - b.write_string("else { e.error('invalid operands to $op: \$left.type_name() and \$right.type_name()')}}}") + b.write_string("else {e.error('invalid operands to $op: \$left.type_name() and \$right.type_name()')}}}") } b.write_string(footer) diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 89d12486d7..26f5ef319f 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -1685,7 +1685,7 @@ pub fn (mut f Fmt) array_init(node ast.ArrayInit) { } f.write(f.table.type_to_str_using_aliases(node.elem_type, f.mod2alias)) if node.has_default { - f.write('\{init: ') + f.write('{init: ') f.expr(node.default_expr) f.write('}') } else { diff --git a/vlib/v/gen/c/assign.v b/vlib/v/gen/c/assign.v index bcdbacd5fd..90959daa5a 100644 --- a/vlib/v/gen/c/assign.v +++ b/vlib/v/gen/c/assign.v @@ -209,7 +209,7 @@ fn (mut g Gen) assign_stmt(node_ ast.AssignStmt) { g.expr(val) } else { if left_sym.kind == .function { - g.write('{ void* _ = ') + g.write('{void* _ = ') } else { g.write('{$styp _ = ') } diff --git a/vlib/v/gen/c/str.v b/vlib/v/gen/c/str.v index 3270600067..e301b29879 100644 --- a/vlib/v/gen/c/str.v +++ b/vlib/v/gen/c/str.v @@ -102,7 +102,7 @@ fn (mut g Gen) gen_expr_to_string(expr ast.Expr, etype ast.Type) { is_var_mut := expr.is_auto_deref_var() str_fn_name := g.get_str_fn(typ) if is_ptr && !is_var_mut { - g.write('str_intp(1, _MOV((StrIntpData[]){{ _SLIT("&"), $si_s_code ,{.d_s = isnil(') + g.write('str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), $si_s_code ,{.d_s = isnil(') g.expr(expr) g.write(') ? _SLIT("nil") : ') } diff --git a/vlib/v/gen/c/str_intp.v b/vlib/v/gen/c/str_intp.v index 5e960aa86d..d88eddb949 100644 --- a/vlib/v/gen/c/str_intp.v +++ b/vlib/v/gen/c/str_intp.v @@ -215,9 +215,9 @@ fn (mut g Gen) string_inter_literal(node ast.StringInterLiteral) { escaped_val := util.smart_quote(val, false) if escaped_val.len > 0 { - g.write('{ _SLIT("$escaped_val"), ') + g.write('{_SLIT("$escaped_val"), ') } else { - g.write('{ _SLIT0, ') + g.write('{_SLIT0, ') } if i >= node.exprs.len { diff --git a/vlib/v/gen/js/auto_str_methods.v b/vlib/v/gen/js/auto_str_methods.v index 3c495a29da..ef551c96d0 100644 --- a/vlib/v/gen/js/auto_str_methods.v +++ b/vlib/v/gen/js/auto_str_methods.v @@ -812,18 +812,18 @@ fn struct_auto_str_func(mut g JsGen, sym &ast.TypeSymbol, field_type ast.Type, f // ptr int can be "nil", so this needs to be casted to a string if sym.kind == .f32 { return 'str_intp(1, _MOV((StrIntpData[]){ - { _SLIT0, $si_g32_code, {.d_f32 = *$method_str }} + {_SLIT0, $si_g32_code, {.d_f32 = *$method_str }} }))' } else if sym.kind == .f64 { return 'str_intp(1, _MOV((StrIntpData[]){ - { _SLIT0, $si_g64_code, {.d_f64 = *$method_str }} + {_SLIT0, $si_g64_code, {.d_f64 = *$method_str }} }))' } else if sym.kind == .u64 { fmt_type := StrIntpType.si_u64 - return 'str_intp(1, _MOV((StrIntpData[]){{ _SLIT0, ${u32(fmt_type) | 0xfe00}, {.d_u64 = *$method_str }}}))' + return 'str_intp(1, _MOV((StrIntpData[]){{_SLIT0, ${u32(fmt_type) | 0xfe00}, {.d_u64 = *$method_str }}}))' } fmt_type := StrIntpType.si_i32 - return 'str_intp(1, _MOV((StrIntpData[]){{ _SLIT0, ${u32(fmt_type) | 0xfe00}, {.d_i32 = *$method_str }}}))' + return 'str_intp(1, _MOV((StrIntpData[]){{_SLIT0, ${u32(fmt_type) | 0xfe00}, {.d_i32 = *$method_str }}}))' } return method_str } diff --git a/vlib/v/gen/js/fn.v b/vlib/v/gen/js/fn.v index b552874353..a7346a8e73 100644 --- a/vlib/v/gen/js/fn.v +++ b/vlib/v/gen/js/fn.v @@ -683,7 +683,7 @@ fn (mut g JsGen) gen_method_decl(it ast.FnDecl, typ FnGenType) { is_varg := i == args.len - 1 && it.is_variadic arg_name := g.js_name(arg.name) if is_varg { - g.writeln('$arg_name = new array(new array_buffer({ arr: $arg_name,len: new int(${arg_name}.length),index_start: new int(0)}));') + g.writeln('$arg_name = new array(new array_buffer({arr: $arg_name,len: new int(${arg_name}.length),index_start: new int(0)}));') } else { asym := g.table.sym(arg.typ) if asym.kind != .interface_ && asym.language != .js { diff --git a/vlib/v/gen/js/js.v b/vlib/v/gen/js/js.v index 7ec0ec470c..946e1203c2 100644 --- a/vlib/v/gen/js/js.v +++ b/vlib/v/gen/js/js.v @@ -152,9 +152,9 @@ pub fn gen(files []&ast.File, table &ast.Table, pref &pref.Preferences) string { // builtin types if g.file.mod.name == 'builtin' && !g.generated_builtin { g.gen_builtin_type_defs() - g.writeln('Object.defineProperty(array.prototype,"len", { get: function() { return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ') - g.writeln('Object.defineProperty(map.prototype,"len", { get: function() { return new int(this.length);}, set: function(l) { } }); ') - g.writeln('Object.defineProperty(array.prototype,"length", { get: function() { return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ') + g.writeln('Object.defineProperty(array.prototype,"len", { get: function() {return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ') + g.writeln('Object.defineProperty(map.prototype,"len", { get: function() {return new int(this.length);}, set: function(l) { } }); ') + g.writeln('Object.defineProperty(array.prototype,"length", { get: function() {return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ') g.generated_builtin = true } if g.is_test && !tests_inited { diff --git a/vlib/v/gen/js/sourcemap/basic_test.v b/vlib/v/gen/js/sourcemap/basic_test.v index 37bdd4ab3d..fc61b5574a 100644 --- a/vlib/v/gen/js/sourcemap/basic_test.v +++ b/vlib/v/gen/js/sourcemap/basic_test.v @@ -3,7 +3,7 @@ module sourcemap fn test_simple() { mut sg := generate_empty_map() mut sm := sg.add_map('hello.js', '/', true, 0, 0) - sm.set_source_content('hello.v', "fn main(){ nprintln('Hello World! Helo \$a')\n}") + sm.set_source_content('hello.v', "fn main(){nprintln('Hello World! Helo \$a')\n}") mlist := [ MappingInput{ @@ -132,7 +132,7 @@ fn test_simple() { json_data := sm.to_json() - expected := '{"version":3,"file":"hello.js","sourceRoot":"\\/","sources":["hello.v"],"sourcesContent":["fn main(){ nprintln(\'Hello World! Helo \$a\')\\n}"],"names":["hello_name"],"mappings":"AAAA;AAAA,EAAA,OAAO,CAACA,GAAR,CAAY,aAAZ,CAAA,CAAA;AAAA"}' + expected := '{"version":3,"file":"hello.js","sourceRoot":"\\/","sources":["hello.v"],"sourcesContent":["fn main(){nprintln(\'Hello World! Helo \$a\')\\n}"],"names":["hello_name"],"mappings":"AAAA;AAAA,EAAA,OAAO,CAACA,GAAR,CAAY,aAAZ,CAAA,CAAA;AAAA"}' assert json_data.str() == expected } diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v index 7ace8ff271..6ca719bd30 100644 --- a/vlib/v/scanner/scanner.v +++ b/vlib/v/scanner/scanner.v @@ -802,13 +802,9 @@ fn (mut s Scanner) text_scan() token.Token { return s.new_token(.rsbr, '', 1) } `{` { + // Skip { in `${` in strings if s.is_inside_string { - // Handle new `hello {name}` string interpolation - if !s.text[s.pos + 1].is_space() && s.text[s.pos - 1] != `$` { - return s.new_token(.str_dollar, '', 1) - } if s.text[s.pos - 1] == `$` { - // Skip { in `${` in strings continue } else { s.inter_cbr_count++ @@ -1229,32 +1225,6 @@ fn (mut s Scanner) ident_string() string { s.pos -= 2 break } - // {var} (ignore in vfmt mode) (skip \{) - if c == `{` && util.is_name_char(s.text[s.pos + 1]) && prevc != `$` && !is_raw - && s.count_symbol_before(s.pos - 1, scanner.backslash) % 2 == 0 { - // Detect certain strings with "{" that are not interpolation: - // e.g. "{init: " (no "}" at the end) - mut is_valid_inter := true - for i := s.pos + 1; i < s.text.len; i++ { - if s.text[i] == `}` { - break - } - if s.text[i] in [`=`, `:`, `\n`, s.inter_quote] { - // We reached the end of the line or string without reaching "}". - // Also if there's "=", there's no way it's a valid interpolation expression: - // e.g. `println("{a.b = 42}")` `println('{foo:bar}')` - is_valid_inter = false - break - } - } - if is_valid_inter { - s.is_inside_string = true - s.is_enclosed_inter = true - // so that s.pos points to $ at the next step - s.pos -= 1 - break - } - } if c != scanner.backslash { backslash_count = 0 } diff --git a/vlib/v/tests/string_interpolation_inner_cbr_test.v b/vlib/v/tests/string_interpolation_inner_cbr_test.v index 5dd0df090f..a1c03df9f4 100644 --- a/vlib/v/tests/string_interpolation_inner_cbr_test.v +++ b/vlib/v/tests/string_interpolation_inner_cbr_test.v @@ -9,12 +9,9 @@ fn test_string_interpolation_inner_cbr() { println(s1) assert s1 == '22' - /* - XTODO s2 := '${St{}}' println(s2) assert s2 == 'St{}' - */ s3 := '${{ 'a': 1 diff --git a/vlib/v/token/pos.v b/vlib/v/token/pos.v index 0c2175391f..f9835bb02f 100644 --- a/vlib/v/token/pos.v +++ b/vlib/v/token/pos.v @@ -18,7 +18,7 @@ pub fn (mut p Pos) free() { } pub fn (p Pos) line_str() string { - return '\{l: ${p.line_nr + 1:5}, c: ${p.col:3}, p: ${p.pos:5}, ll: ${p.last_line + 1:5}}' + return '{l: ${p.line_nr + 1:5}, c: ${p.col:3}, p: ${p.pos:5}, ll: ${p.last_line + 1:5}}' } pub fn (pos Pos) extend(end Pos) Pos {