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'
// 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 {
return ''
}
@ -67,7 +67,7 @@ pub fn (b mut Builder) last_n(n int) string {
// buf == 'hello 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 {
return ''
}

View File

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