Skip to content

Commit 1e33ba6

Browse files
committed
only adding space if value is declared in YulVariableDeclarationStatement
1 parent e33e1f8 commit 1e33ba6

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/slang-nodes/YulVariableDeclarationStatement.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { NonterminalKind } from '@nomicfoundation/slang/kinds/index.js';
22
import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js';
3+
import { joinExisting } from '../slang-utils/join-existing.js';
34
import { YulVariableDeclarationValue } from './YulVariableDeclarationValue.js';
45
import { YulVariableNames } from './YulVariableNames.js';
56

@@ -46,11 +47,9 @@ export class YulVariableDeclarationStatement implements SlangNode {
4647
path: AstPath<YulVariableDeclarationStatement>,
4748
print: PrintFunction
4849
): Doc {
49-
return [
50-
'let',
51-
path.call(print, 'variables'),
52-
' ',
50+
return joinExisting(' ', [
51+
['let', path.call(print, 'variables')],
5352
path.call(print, 'value')
54-
];
53+
]);
5554
}
5655
}

0 commit comments

Comments
 (0)