Mapping
woke.ast.ir.type_name.mapping
module
#
Mapping
class
#
Bases: TypeNameAbc
Mapping type name.
Example
A mapping type name can be used:
- inside a VariableDeclaration:
mapping(address => uint)
in line 1,mapping(address => mapping(address => uint))
in line 8,
- inside a UsingForDirective:
mapping(address => uint)
in line 5,
- inside an ArrayTypeName:
mapping(address => uint)
in line 9,
- inside a Mapping:
mapping(address => uint)
in line 8.
Source code in woke/ast/ir/type_name/mapping.py
key_type: Union[ElementaryTypeName, UserDefinedTypeName]
property
#
Can only be:
- an ElementaryTypeName,
- a UserDefinedTypeName of a Contract type,
- a UserDefinedTypeName of an Enum type,
- a UserDefinedTypeName of a UserDefinedValueType type.
Returns:
Type | Description |
---|---|
Union[ElementaryTypeName, UserDefinedTypeName]
|
Mapping key type name. |
parent: Union[VariableDeclaration, UsingForDirective, ArrayTypeName, Mapping]
property
#
Returns:
Type | Description |
---|---|
Union[VariableDeclaration, UsingForDirective, ArrayTypeName, Mapping]
|
Parent IR node. |
value_type: TypeNameAbc
property
#
Returns:
Type | Description |
---|---|
TypeNameAbc
|
Mapping value type name. |