parent
							
								
									731015cd9b
								
							
						
					
					
						commit
						eed882950c
					
				|  | @ -36,3 +36,15 @@ fn really_long_branch_exprs() { | |||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| fn match_branch_extra_comma() { | ||||
| 	match x { | ||||
| 		Foo, Bar {} | ||||
| 		int, string {} | ||||
| 	} | ||||
| 	match n { | ||||
| 		0...5 {} | ||||
| 		2, 3 {} | ||||
| 		else {} | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -34,3 +34,15 @@ fn really_long_branch_exprs() { | |||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| fn match_branch_extra_comma() { | ||||
| 	match x { | ||||
| 		Foo, Bar, {} | ||||
| 		int,,, string, {} | ||||
| 	} | ||||
| 	match n { | ||||
| 		0...5, {} | ||||
| 		2, 3, {} | ||||
| 		else {} | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -197,6 +197,14 @@ fn (mut p Parser) match_expr() ast.MatchExpr { | |||
| 					break | ||||
| 				} | ||||
| 				p.check(.comma) | ||||
| 				if p.pref.is_fmt { | ||||
| 					if p.tok.kind == .lcbr { | ||||
| 						break | ||||
| 					} | ||||
| 					for p.tok.kind == .comma { | ||||
| 						p.next() | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 			is_sum_type = true | ||||
| 		} else { | ||||
|  | @ -226,7 +234,16 @@ fn (mut p Parser) match_expr() ast.MatchExpr { | |||
| 				if p.tok.kind != .comma { | ||||
| 					break | ||||
| 				} | ||||
| 
 | ||||
| 				p.check(.comma) | ||||
| 				if p.pref.is_fmt { | ||||
| 					if p.tok.kind == .lcbr { | ||||
| 						break | ||||
| 					} | ||||
| 					for p.tok.kind == .comma { | ||||
| 						p.next() | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		branch_last_pos := p.prev_tok.position() | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue