-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathfmt.sol
100 lines (87 loc) · 2.05 KB
/
fmt.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
pragma solidity ^0.8.13;
/// @title A Hello world example
contract HelloWorld {
/// Some example struct
struct Person {
uint256 age;
address wallet;
}
/**
* Here's a more double asterix comment
*/
Person public theDude;
/// Constructs the dude
/// @param age The dude's age
constructor(uint256 age) {
theDude = Person({age: age, wallet: msg.sender});
}
/**
* @dev does nothing
*/
function example() public {
/**
* Does this add a whitespace error?
*
* Let's find out.
*/
}
/**
* @dev Calculates a rectangle's surface and perimeter.
* @param w Width of the rectangle.
* @param h Height of the rectangle.
* @return s The calculated surface.
* @return p The calculated perimeter.
*/
function rectangle(uint256 w, uint256 h)
public
pure
returns (uint256 s, uint256 p)
{
s = w * h;
p = 2 * (w + h);
}
/// A long doc line comment that will be wrapped
function docLineOverflow() external {}
function docLinePostfixOverflow() external {}
/// A long doc line comment that will be wrapped
/**
* @notice Here is my comment
* - item 1
* - item 2
* Some equations:
* y = mx + b
*/
function anotherExample() external {}
/**
* contract A {
* function foo() public {
* // does nothing.
* }
* }
*/
function multilineIndent() external {}
/**
* contract A {
* function foo() public {
* // does nothing.
* }
* }
*/
function multilineMalformedIndent() external {}
/**
* contract A {
* function withALongNameThatWillCauseCommentWrap() public {
* // does nothing.
* }
* }
*/
function malformedIndentOverflow() external {}
}
/**
* contract A {
* function foo() public {
* // does nothing.
* }
* }
*/
function freeFloatingMultilineIndent() {}