[Issue 22882] New: Floating-point literals with leading zeroes incorrectly throw octal errors
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Mar 16 16:53:09 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22882
Issue ID: 22882
Summary: Floating-point literals with leading zeroes
incorrectly throw octal errors
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: 8jst at queensu.ca
Floating-point literals with leading zeroes incorrectly throw an octal digit
error, as follows:
writeln(07.0); // 7
writeln(08.0); // Error: octal digit expected, not `8`
writeln(010.9); // 10.9
writeln(018.9); // Error: octal digit expected, not `8`
writeln(00077777.0); // 77777
writeln(00077778.0); // Error: octal digit expected, not `8`
The error is in lexer.d; errorDigit is set in number() in the initial switch
case, but when a '.' is subsequently handled later in the function, the error
state is never unset.
--
More information about the Digitalmars-d-bugs
mailing list