parser: better const error
							parent
							
								
									5e4c5f189f
								
							
						
					
					
						commit
						b15780ae51
					
				|  | @ -1514,7 +1514,10 @@ fn (p mut Parser) const_decl() ast.ConstDecl { | ||||||
| 	} | 	} | ||||||
| 	pos := p.tok.position() | 	pos := p.tok.position() | ||||||
| 	p.check(.key_const) | 	p.check(.key_const) | ||||||
| 	p.check(.lpar) | 	if p.tok.kind != .lpar { | ||||||
|  | 		p.error('consts must be grouped, e.g.\nconst (\n\ta = 1\n)') | ||||||
|  | 	} | ||||||
|  | 	p.next() // (
 | ||||||
| 	var fields := []ast.ConstField | 	var fields := []ast.ConstField | ||||||
| 	for p.tok.kind != .rpar { | 	for p.tok.kind != .rpar { | ||||||
| 		if p.tok.kind == .comment { | 		if p.tok.kind == .comment { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue