diff options
| author | Pierre Roux | 2020-03-28 14:25:27 +0100 |
|---|---|---|
| committer | Pierre Roux | 2020-05-09 18:00:00 +0200 |
| commit | 0ee6e30022e5b5b244f5d9cd16acb6017817a6c0 (patch) | |
| tree | 10cdde5a7e16e2967a137651943263399e1f1155 /doc/sphinx/language/core/basic.rst | |
| parent | 692c642672f863546b423d72c714c1417164e506 (diff) | |
[doc] Add hexadecimal numerals
Diffstat (limited to 'doc/sphinx/language/core/basic.rst')
| -rw-r--r-- | doc/sphinx/language/core/basic.rst | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/doc/sphinx/language/core/basic.rst b/doc/sphinx/language/core/basic.rst index 9473cc5a15..50e68276d2 100644 --- a/doc/sphinx/language/core/basic.rst +++ b/doc/sphinx/language/core/basic.rst @@ -111,18 +111,27 @@ Identifiers Numerals Numerals are sequences of digits with an optional fractional part - and exponent, optionally preceded by a minus sign. :n:`@int` is an integer; - a numeral without fractional or exponent parts. :n:`@num` is a non-negative + and exponent, optionally preceded by a minus sign. Hexadecimal numerals + start with ``0x`` or ``0X``. :n:`@int` is an integer; + a numeral without fractional nor exponent parts. :n:`@num` is a non-negative integer. Underscores embedded in the digits are ignored, for example ``1_000_000`` is the same as ``1000000``. .. insertprodn numeral digit .. prodn:: - numeral ::= {+ @digit } {? . {+ @digit } } {? {| e | E } {? {| + | - } } {+ @digit } } - int ::= {? - } {+ @digit } - num ::= {+ @digit } digit ::= 0 .. 9 + digitu ::= {| @digit | _ } + hexdigit ::= {| 0 .. 9 | a..f | A..F } + hexdigitu ::= {| @hexdigit | _ } + decnum ::= @digit {* @digitu } + hexnum ::= {| 0x | 0X } @hexdigit {* @hexdigitu } + num ::= {| @decnum | @hexnum } + sign ::= {| + | - } + int ::= {? - } @num + decimal ::= @decnum {? . {+ @digitu } } {? {| e | E } {? @sign } @decnum } + hexadecimal ::= @hexnum {? . {+ @hexdigitu } } {? {| p | P } {? @sign } @decnum } + numeral ::= {? - } {| @decimal | @hexadecimal } Strings Strings begin and end with ``"`` (double quote). Use ``""`` to represent |
