aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-08-16 22:31:23 +0800
committerchriseth <chris@ethereum.org>2016-08-16 22:31:23 +0800
commitec3298535ebe1d6602df9196b81c92d4a88b4821 (patch)
treef09308a0955b9fb08736b8afa59a381cb909e232 /docs
parent970260bf0f8b9cdfd46c6956c14e267788ffdc0f (diff)
downloaddexon-solidity-ec3298535ebe1d6602df9196b81c92d4a88b4821.tar.gz
dexon-solidity-ec3298535ebe1d6602df9196b81c92d4a88b4821.tar.zst
dexon-solidity-ec3298535ebe1d6602df9196b81c92d4a88b4821.zip
Introduce hex literals (#832)
* Introduce hex keyword token * Support hex literals * Include tests for hex literals * Document hex literals
Diffstat (limited to 'docs')
-rw-r--r--docs/types.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/types.rst b/docs/types.rst
index 12a35aaf..31f6b53d 100644
--- a/docs/types.rst
+++ b/docs/types.rst
@@ -218,6 +218,15 @@ String literals are written with either double or single-quotes (``"foo"`` or ``
String literals support escape characters, such as ``\n``, ``\xNN`` and ``\uNNNN``. ``\xNN`` takes a hex value and inserts the appropriate byte, while ``\uNNNN`` takes a Unicode codepoint and inserts an UTF-8 sequence.
+.. index:: literal, bytes
+
+Hexadecimal Literals
+--------------------
+
+Hexademical Literals are prefixed with the keyword ``hex`` and are enclosed in double or single-quotes (``hex"001122FF"``). Their content must be a hexadecimal string and their value will be the binary representation of those values.
+
+Hexademical Literals behave like String Literals and have the same convertibility restrictions.
+
.. index:: enum
.. _enums: