fix fmt test

pull/3811/head
Alexander Medvednikov 2020-02-22 17:07:03 +01:00
parent d510cd1e0d
commit dd29bfe4d2
2 changed files with 10 additions and 11 deletions

View File

@ -75,8 +75,7 @@ fn get_user() ?User {
} }
fn get_user_ptr() &User { fn get_user_ptr() &User {
return &User{ return &User{ }
}
} }
struct Foo { struct Foo {

View File

@ -56,7 +56,7 @@ pub fn parse_stmt(text string, table &table.Table, scope &ast.Scope) ast.Stmt {
pref: &pref.Preferences{} pref: &pref.Preferences{}
scope: scope scope: scope
// scope: &ast.Scope{start_pos: 0, parent: 0} // scope: &ast.Scope{start_pos: 0, parent: 0}
} }
p.init_parse_fns() p.init_parse_fns()
p.read_first_token() p.read_first_token()
@ -320,7 +320,7 @@ pub fn (p mut Parser) stmt() ast.Stmt {
return ast.ExprStmt{ return ast.ExprStmt{
expr: expr expr: expr
// typ: typ // typ: typ
} }
} }
} }
@ -1096,11 +1096,11 @@ fn (p mut Parser) if_expr() ast.Expr {
stmts: stmts stmts: stmts
else_stmts: else_stmts else_stmts: else_stmts
// typ: typ // typ: typ
pos: pos pos: pos
has_else : has_else has_else: has_else
// left: left // left: left
} }
return node return node
} }
@ -1302,7 +1302,7 @@ fn (p mut Parser) const_decl() ast.ConstDecl {
mut exprs := []ast.Expr mut exprs := []ast.Expr
for p.tok.kind != .rpar { for p.tok.kind != .rpar {
name := p.prepend_mod(p.check_name()) name := p.prepend_mod(p.check_name())
// println('const: $name') // println('!!const: $name')
p.check(.assign) p.check(.assign)
expr,typ := p.expr(0) expr,typ := p.expr(0)
fields << ast.Field{ fields << ast.Field{
@ -1499,10 +1499,10 @@ fn (p mut Parser) var_decl() ast.VarDecl {
node := ast.VarDecl{ node := ast.VarDecl{
name: name name: name
expr: expr // p.expr(token.lowest_prec) expr: expr // p.expr(token.lowest_prec)
is_mut: is_mut is_mut: is_mut
// typ: typ // typ: typ
pos: p.tok.position() pos: p.tok.position()
} }
p.scope.register_var(node) p.scope.register_var(node)
@ -1621,7 +1621,7 @@ fn (p mut Parser) match_expr() ast.Expr {
blocks: blocks blocks: blocks
match_exprs: match_exprs match_exprs: match_exprs
// typ: typ // typ: typ
cond: cond cond: cond
} }
return node return node