Skip to content
Permalink
Browse files

Modify `numSpacer` more uniformly and simply

  • Loading branch information...
takenobu-hs committed Nov 10, 2017
1 parent a448733 commit e5b5173d3f7fef6024a9f045421b489a37051e2c
Showing with 12 additions and 12 deletions.
  1. +12 −12 proposals/0000-numeric-underscores.rst
@@ -57,25 +57,25 @@ When the ``NumericUnderscores`` language extension is enabled, syntax is changed
.. code-block:: none

-- `numSpacer` is enabled with NumericUnderscores extension
numSpacer = _
numSpacer = {_}

decimal → digit[{numSpacer | digit} digit]
octal → octit[{numSpacer | octit} octit]
hexadecimal → hexit[{numSpacer | hexit} hexit]
binary → binit[{numSpacer | binit} binit]
decimal → digit{numSpacer digit}
octal → octit{numSpacer octit}
hexadecimal → hexit{numSpacer hexit}
binary → binit{numSpacer binit}

integer → decimal
| 0 (o | O) {numSpacer} octal
| 0 (x | X) {numSpacer} hexadecimal
| 0 (b | B) {numSpacer} binary
| 0 (o | O) numSpacer octal
| 0 (x | X) numSpacer hexadecimal
| 0 (b | B) numSpacer binary

float → decimal . decimal [exponent]
| decimal exponent
| 0 (x | X) {numSpacer} hexadecimal . hexadecimal [bin_exponent]
| 0 (x | X) {numSpacer} hexadecimal bin_exponent
| 0 (x | X) numSpacer hexadecimal . hexadecimal [bin_exponent]
| 0 (x | X) numSpacer hexadecimal bin_exponent

exponent → {numSpacer} (e | E) [+ | -] decimal
bin_exponent → {numSpacer} (p | P) [+ | -] decimal
exponent → numSpacer (e | E) [+ | -] decimal
bin_exponent → numSpacer (p | P) [+ | -] decimal

-- Underscores (_) in numeric literals are simply ignored.

0 comments on commit e5b5173

Please sign in to comment.
You can’t perform that action at this time.