Skip to content

Commit 196dfea

Browse files
committed
printing transient keyword
1 parent fa1f7a4 commit 196dfea

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/nodes/VariableDeclaration.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const storageLocation = (node) =>
1919

2020
const immutable = (node) => (node.isImmutable ? ' immutable' : '');
2121

22+
const transient = (node) => (node.isTransient ? ' transient' : '');
23+
2224
const override = (node, path, print) => {
2325
if (!node.override) return '';
2426
if (node.override.length === 0) return [line, 'override'];
@@ -43,6 +45,7 @@ export const VariableDeclaration = {
4345
constantKeyword(node),
4446
storageLocation(node),
4547
immutable(node),
48+
transient(node),
4649
override(node, path, print),
4750
name(node)
4851
])
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
contract Contract {
22
bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d4749;
3+
4+
uint256 public transient number1;
5+
uint256 transient public number2;
6+
uint256 constant public BROADCAST_INDEX = type(uint256).max;
7+
bytes32 public constant BROADCAST_INDEX1 = bytes32(type(uint256).max);
38
}

tests/format/StateVariableDeclarations/__snapshots__/jsfmt.spec.js.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,22 @@ printWidth: 80
88
=====================================input======================================
99
contract Contract {
1010
bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d4749;
11+
12+
uint256 public transient number1;
13+
uint256 transient public number2;
14+
uint256 constant public BROADCAST_INDEX = type(uint256).max;
15+
bytes32 public constant BROADCAST_INDEX1 = bytes32(type(uint256).max);
1116
}
1217
1318
=====================================output=====================================
1419
contract Contract {
1520
bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH =
1621
0x035aff83d86937d35b32e04f0ddc6ff469290eef2f1b692d8a815c89404d4749;
22+
23+
uint256 public transient number1;
24+
uint256 public transient number2;
25+
uint256 public constant BROADCAST_INDEX = type(uint256).max;
26+
bytes32 public constant BROADCAST_INDEX1 = bytes32(type(uint256).max);
1727
}
1828
1929
================================================================================

0 commit comments

Comments
 (0)