replace %return with try

See #632

better fits the convention of using keywords for control flow
This commit is contained in:
Andrew Kelley
2018-01-07 16:51:46 -05:00
parent de1f57926f
commit 66717db735
41 changed files with 810 additions and 801 deletions

View File

@@ -162,7 +162,7 @@ fn testValid(bytes: []const u8, expected_codepoint: u32) {
}
fn testDecode(bytes: []const u8) -> %u32 {
const length = %return utf8ByteSequenceLength(bytes[0]);
const length = try utf8ByteSequenceLength(bytes[0]);
if (bytes.len < length) return error.UnexpectedEof;
std.debug.assert(bytes.len == length);
return utf8Decode(bytes);