mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Parsing difference between "0x00." and "0X00." literals #2371
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
- Detect recursive creation of generics #2366.
|
||||
- Compiler assertion when defining a function with return type untyped_list #2368.
|
||||
- Compiler assert when using generic parameters list without any parameters. #2369
|
||||
- Parsing difference between "0x00." and "0X00." literals #2371
|
||||
|
||||
### Stdlib changes
|
||||
- Add `==` to `Pair`, `Triple` and TzDateTime. Add print to `Pair` and `Triple`.
|
||||
|
||||
@@ -1883,7 +1883,7 @@ static Expr *parse_double(ParseContext *c, Expr *left, SourceSpan lhs_start)
|
||||
char *err;
|
||||
Expr *number = EXPR_NEW_TOKEN(EXPR_CONST);
|
||||
const char *original = symstr(c);
|
||||
bool is_hex = original[0] == '0' && original[1] == 'x';
|
||||
bool is_hex = original[0] == '0' && (original[1] == 'x' || 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)
|
||||
|
||||
4
test/test_suite/floats/parse_hex_float.c3
Normal file
4
test/test_suite/floats/parse_hex_float.c3
Normal file
@@ -0,0 +1,4 @@
|
||||
fn void main()
|
||||
{
|
||||
$echo $typeof(0X00.).nameof; // #error: Hex floating points must end with 'p' or 'P'
|
||||
}
|
||||
Reference in New Issue
Block a user