Skip to content

Commit

Permalink
Fix hexadecimal numbers always prefixed with 0x
Browse files Browse the repository at this point in the history
If a number was just "42", it will be treated as 0x42. This commit fixes it so 0x hexadecimal prefixes are not emitted if they're explicitly omitted.
  • Loading branch information
winscripter authored Jul 24, 2024
1 parent d62b045 commit cf63112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ILSourceParser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ internal static Parser<char> ParseHexChar()
internal static Parser<string> ParseHexNumber()
{
return (
from prefix in ParseHexPrefix()
from prefix in Parse.String("0x")
from numbers in ParseHexChar().AtLeastOnce().Text()
select $"0x{numbers}"
)
Expand Down

0 comments on commit cf63112

Please sign in to comment.