mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Deprecate f32, f64 and f128 suffixes.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
- `@jump` now included in `--list-attributes` #2155.
|
||||
- Add `$$matrix_mul` and `$$matrix_transpose` builtins.
|
||||
- Add `d` as floating point suffix for `double` types.
|
||||
- Deprecate `f32`, `f64` and `f128` suffixes.
|
||||
|
||||
### Fixes
|
||||
- Assert triggered when casting from `int[2]` to `uint[2]` #2115
|
||||
|
||||
@@ -1822,6 +1822,14 @@ static Expr *parse_double(ParseContext *c, Expr *left)
|
||||
bool is_hex = original[0] == '0' && original[1] == 'x';
|
||||
// This is set to try to print in a similar manner as the input.
|
||||
number->const_expr.is_hex = is_hex;
|
||||
if (c->data.lex_len > 3)
|
||||
{
|
||||
const char *last = c->data.lex_start + c->data.lex_len - 3;
|
||||
if (last[0] == 'f' && ((last[1] == '3' && last[2] == '2') || (last[1] == '6' && last[2] == '4')))
|
||||
{
|
||||
SEMA_DEPRECATED(number, "Float number suffixes are deprecated, use 'f' and 'd' instead.'");
|
||||
}
|
||||
}
|
||||
Float f = is_hex ? float_from_hex(original, &err) : float_from_string(original, &err);
|
||||
if (f.type == TYPE_POISONED)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user