remove %% prefix operator

See #632
closes #545
closes #510

this makes #651 higher priority
This commit is contained in:
Andrew Kelley
2018-01-09 00:07:01 -05:00
parent 98a95cc698
commit 3c094116aa
46 changed files with 550 additions and 641 deletions

View File

@@ -19,7 +19,7 @@ error Utf8EncodesSurrogateHalf;
error Utf8CodepointTooLarge;
/// Decodes the UTF-8 codepoint encoded in the given slice of bytes.
/// bytes.len must be equal to %%utf8ByteSequenceLength(bytes[0]).
/// bytes.len must be equal to utf8ByteSequenceLength(bytes[0]) catch unreachable.
/// If you already know the length at comptime, you can call one of
/// utf8Decode2,utf8Decode3,utf8Decode4 directly instead of this function.
pub fn utf8Decode(bytes: []const u8) -> %u32 {
@@ -158,7 +158,7 @@ fn testError(bytes: []const u8, expected_err: error) {
}
fn testValid(bytes: []const u8, expected_codepoint: u32) {
std.debug.assert(%%testDecode(bytes) == expected_codepoint);
std.debug.assert((testDecode(bytes) catch unreachable) == expected_codepoint);
}
fn testDecode(bytes: []const u8) -> %u32 {