File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
tests/format/AllSolidityFeatures Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 11const Mapping = {
2- print : ( { path, print } ) => [
3- 'mapping(' ,
4- path . call ( print , 'keyType' ) ,
5- ' => ' ,
6- path . call ( print , 'valueType' ) ,
7- ')'
8- ]
2+ print : ( { path, print } ) => {
3+ const keyType = path . call ( print , 'keyType' ) ;
4+ const keyName = path . call ( print , 'keyName' ) ;
5+ const valueType = path . call ( print , 'valueType' ) ;
6+ const valueName = path . call ( print , 'valueName' ) ;
7+ return [
8+ 'mapping(' ,
9+ keyType ,
10+ keyName ? ` ${ keyName } ` : '' ,
11+ ' => ' ,
12+ valueType ,
13+ valueName ? ` ${ valueName } ` : '' ,
14+ ')'
15+ ] ;
16+ }
917} ;
1018
1119module . exports = Mapping ;
Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ contract c {
8888 function setData (uint pos , uint value ) internal { data[pos] = value; }
8989 function getData (uint pos ) internal { return data[pos]; }
9090 mapping (uint => uint ) data;
91+ mapping (uint id = > uint ) data;
92+ mapping (address owner = > mapping (address spender = > uint amount )) allowances;
9193}
9294
9395contract Sharer {
Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ contract c {
9696 function setData(uint pos , uint value ) internal { data [pos ] = value ; }
9797 function getData(uint pos ) internal { return data [pos ]; }
9898 mapping (uint => uint ) data ;
99+ mapping (uint id => uint ) data ;
100+ mapping (address owner => mapping (address spender => uint amount )) allowances ;
99101}
100102
101103contract Sharer {
@@ -651,6 +653,8 @@ contract c {
651653 }
652654
653655 mapping (uint => uint ) data ;
656+ mapping (uint id => uint ) data ;
657+ mapping (address owner => mapping (address spender => uint amount )) allowances ;
654658}
655659
656660contract Sharer {
You can’t perform that action at this time.
0 commit comments