wake.ir.expressions.literal
module
#
Literal
class
#
Bases: ExpressionAbc
May represent a literal of the following types (see LiteralKind):
- boolean, e.g.
true,false, - integer, e.g.
-1,.2,3e10,123_456,0x123,1_002e34, - string, e.g.
"Hello World!", - hex string, e.g.
hex"1234aabb", - unicode string, e.g.
unicode"Hello World! ๐",
Source code in wake/ir/expressions/literal.py
hex_value: bytes
property
#
Important
Does not return the hexadecimal representation, but rather the value encoded into bytes.
For example, hex"1234aabb" would return b'4ยชยป' and .2 would return b'.2'.
Returns:
| Type | Description |
|---|---|
bytes
|
Hex string literal value. |
kind: LiteralKind
property
#
Returns:
| Type | Description |
|---|---|
LiteralKind
|
Literal kind. |
subdenomination: Optional[str]
property
#
Example
For example wei, ether, seconds, days, etc.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Literal subdenomination, if any. |
value: Optional[str]
property
#
Is None for hex string literals.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Literal value. |