parser: change `for` error message
parent
b15780ae51
commit
a680db44ed
|
@ -1089,7 +1089,7 @@ fn (p mut Parser) for_stmt() ast.Stmt {
|
||||||
is_inf: true
|
is_inf: true
|
||||||
}
|
}
|
||||||
} else if p.tok.kind in [.key_mut, .key_var] {
|
} else if p.tok.kind in [.key_mut, .key_var] {
|
||||||
p.error('`mut` is not required in for loops')
|
p.error('`mut` is not needed in for loops')
|
||||||
} else if p.peek_tok.kind in [.decl_assign, .assign, .semicolon] || p.tok.kind == .semicolon {
|
} else if p.peek_tok.kind in [.decl_assign, .assign, .semicolon] || p.tok.kind == .semicolon {
|
||||||
// `for i := 0; i < 10; i++ {`
|
// `for i := 0; i < 10; i++ {`
|
||||||
var init := ast.Stmt{}
|
var init := ast.Stmt{}
|
||||||
|
|
Loading…
Reference in New Issue