1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: replace the switch statement in parse()

This commit is contained in:
Alexander Medvednikov
2019-10-24 15:44:46 +03:00
parent 3a929faf26
commit bac690bbc8
2 changed files with 39 additions and 16 deletions

View File

@ -29,3 +29,14 @@ fn test_in() {
assert color in [.red, .green]
assert num == 3
}
fn test_match() {
color := Color.red
num := 3
match color {
.red { assert true }
.green { assert false }
else { assert false }
}
assert num == 3
}