pub fn scanDigit(self: *FloatStream, comptime base: u8) ?u8 self: *FloatStreambase: u897
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119pub fn scanDigit(self: *FloatStream, comptime base: u8) ?u8 {
comptime std.debug.assert(base == 10 or base == 16);
retry: while (true) {
if (self.first()) |ok| {
if ('0' <= ok and ok <= '9') {
self.advance(1);
return ok - '0';
} else if (base == 16 and 'a' <= ok and ok <= 'f') {
self.advance(1);
return ok - 'a' + 10;
} else if (base == 16 and 'A' <= ok and ok <= 'F') {
self.advance(1);
return ok - 'A' + 10;
} else if (ok == '_') {
self.advance(1);
self.underscore_count += 1;
continue :retry;
}
}
return null;
}
}