forked from compiler-explorer/compiler-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add digit separators to long numbers in numeric tooltip (compiler-exp…
…lorer#6221) Long numbers are sometimes hard to read in the numeric tooltip. To improve readability, this PR adds language-specific digit separators to the numeric tooltip. Decimal numbers are grouped into chunks of three digits while hexadecimal numbers are grouped into chunks of length four. The digit separator is language-specific and chosen so that the number is a valid token in the source language. [Examples](https://godbolt.org/z/s86cMbjeK): * for C++, hovering the number `8583909746840200552` shows this tooltip: `8'583'909'746'840'200'552 = 0x7720'2C6F'6C6C'6568 = 6.5188685003648344e+265` * for Python, hovering the number `-12345678` shows this tooltip: `-123_456_789 = 0xFFFF_FFFF_F8A4_32EB = -2.66427945e+34f` For languages that don’t have a `digitSeparator` set, the tooltip is not changed.
- Loading branch information
Showing
5 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters