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

parser: disallow statements after a return, branch check $if, $else, switch, and loops correctly

This commit is contained in:
Julian Schurhammer
2019-08-10 20:26:42 +12:00
committed by Alexander Medvednikov
parent 58b52aa9fb
commit 1864e92ff4
26 changed files with 97 additions and 94 deletions

View File

@@ -9,7 +9,6 @@ fn test_parse_user() {
s := '{"age": 10, "nums": [1,2,3]}'
u := json.decode(User, s) or {
exit(1)
return
}
assert u.age == 10
assert u.nums.len == 3