Allow F as floating-point suffix

This commit is contained in:
Robin Voetter
2021-03-30 13:08:34 +02:00
parent 938359c6c9
commit 1e7b5edb10
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});
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;
}
},