Skip to content

Commit

Permalink
Fix lexer generating hex float warning incorrectly.
Browse files Browse the repository at this point in the history
  • Loading branch information
GGG-KILLER committed Mar 10, 2024
1 parent 4b918f8 commit 2ca1e5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Compilers/Lua/Portable/Parser/Lexer.Numbers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,12 @@ private void ParseHexadecimalNumber(ref TokenInfo info)
info.ValueKind = ValueKind.Complex;
info.ComplexValue = new Complex(0, result);
}
// We check for IntegerFormats.NotSupported because on places where integers aren't supported,
// numbers are parsed as doubles which means there's no overflow behavior so we shouldn't check
// for it either.
else if (isHexFloat || _options.SyntaxOptions.HexIntegerFormat == IntegerFormats.NotSupported)
{
if (!_options.SyntaxOptions.AcceptHexFloatLiterals)
if (isHexFloat && !_options.SyntaxOptions.AcceptHexFloatLiterals)
AddError(ErrorCode.ERR_HexFloatLiteralNotSupportedInVersion);

var result = 0d;
Expand Down

0 comments on commit 2ca1e5d

Please sign in to comment.