fix fmt2 test

pull/4179/head
Alexander Medvednikov 2020-04-01 17:52:50 +02:00
parent e3713de41d
commit 3ef6436bef
3 changed files with 11 additions and 14 deletions

View File

@ -788,12 +788,6 @@ pub fn (c mut Checker) expr(node ast.Expr) table.Type {
it.expr_type = c.expr(it.expr) it.expr_type = c.expr(it.expr)
return table.string_type return table.string_type
} }
/*
ast.UnaryExpr {
c.expr(it.left)
}
*/
else {} else {}
// println('checker.expr(): unhandled node') // println('checker.expr(): unhandled node')
// TODO: find nil string bug triggered with typeof // TODO: find nil string bug triggered with typeof

View File

@ -8,6 +8,8 @@ fn main() {
c := 'a: $a b: $b i: $i' c := 'a: $a b: $b i: $i'
d := 'a: ${a:5s} b: ${b:-5s} i: ${i:20d}' d := 'a: ${a:5s} b: ${b:-5s} i: ${i:20d}'
println('a: $a $b xxx') println('a: $a $b xxx')
eprintln('c: $c') // QTODO
//eprintln('c: $c')
eprintln('c: $c .')
println(d) println(d)
} }

View File

@ -604,6 +604,7 @@ pub fn (p mut Parser) name_expr() ast.Expr {
} }
// Raw string (`s := r'hello \n ') // Raw string (`s := r'hello \n ')
if p.tok.lit in ['r', 'c'] && p.peek_tok.kind == .string { if p.tok.lit in ['r', 'c'] && p.peek_tok.kind == .string {
// QTODO
// && p.prev_tok.kind != .str_dollar { // && p.prev_tok.kind != .str_dollar {
return p.string_expr() return p.string_expr()
} }