Allow F as floating-point suffix

This commit is contained in:
Robin Voetter
2021-03-30 13:08:34 +02:00
parent 954ca65ed9
commit 2064c912aa
2 changed files with 2 additions and 2 deletions

View File

@@ -506,7 +506,7 @@ fn Renderer(comptime WriterType: type) type {
try self.writer.print("@as(f32, {s}.{s})", .{tok.text, decimal.text}); try self.writer.print("@as(f32, {s}.{s})", .{tok.text, decimal.text});
const f = (try tokenizer.next()) orelse return error.InvalidConstantExpr; const f = (try tokenizer.next()) orelse return error.InvalidConstantExpr;
if (f.kind != .id or !mem.eql(u8, f.text, "f")) { if (f.kind != .id or f.text.len != 1 or (f.text[0] != 'f' and f.text[0] != 'F')) {
return error.InvalidApiConstant; return error.InvalidApiConstant;
} }
}, },