fix prod build

pull/4088/head
Alexander Medvednikov 2020-03-21 07:04:53 +01:00
parent 5072320803
commit 5f61fbcbe3
2 changed files with 5 additions and 6 deletions

View File

@ -57,7 +57,7 @@ pub fn (b mut Builder) writeln(s string) {
// buf == 'hello world' // buf == 'hello world'
// last_n(5) returns 'world' // last_n(5) returns 'world'
pub fn (b mut Builder) last_n(n int) string { pub fn (b &Builder) last_n(n int) string {
if n > b.len { if n > b.len {
return '' return ''
} }
@ -67,7 +67,7 @@ pub fn (b mut Builder) last_n(n int) string {
// buf == 'hello world' // buf == 'hello world'
// after(6) returns 'world' // after(6) returns 'world'
pub fn (b mut Builder) after(n int) string { pub fn (b &Builder) after(n int) string {
if n >= b.len { if n >= b.len {
return '' return ''
} }

View File

@ -1663,7 +1663,6 @@ fn (g mut Gen) string_inter_literal(node ast.StringInterLiteral) {
if i >= node.exprs.len { if i >= node.exprs.len {
continue continue
} }
pos := g.out.len
match node.expr_types[i] { match node.expr_types[i] {
table.string_type { table.string_type {
g.write('%.*s') g.write('%.*s')
@ -1679,13 +1678,13 @@ fn (g mut Gen) string_inter_literal(node ast.StringInterLiteral) {
for i, expr in node.exprs { for i, expr in node.exprs {
if node.expr_types[i] == table.string_type { if node.expr_types[i] == table.string_type {
// `name.str, name.len,` // `name.str, name.len,`
g.expr(node.exprs[i]) g.expr(expr)
g.write('.len, ') g.write('.len, ')
g.expr(node.exprs[i]) g.expr(expr)
g.write('.str') g.write('.str')
} }
else { else {
g.expr(node.exprs[i]) g.expr(expr)
} }
if i < node.exprs.len - 1 { if i < node.exprs.len - 1 {
g.write(', ') g.write(', ')