Skip to content

Commit 0e77127

Browse files
committed
rearrange Node's print signature to delete unneeded path parameter
1 parent 2c29d42 commit 0e77127

167 files changed

Lines changed: 283 additions & 316 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/slang-nodes/AbicoderPragma.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SlangNode } from './SlangNode.js';
33
import { AbicoderVersion } from './AbicoderVersion.js';
44

55
import type * as ast from '@nomicfoundation/slang/ast';
6-
import type { AstPath, Doc } from 'prettier';
6+
import type { Doc } from 'prettier';
77
import type { CollectedMetadata, PrintFunction } from '../types.d.ts';
88

99
export class AbicoderPragma extends SlangNode {
@@ -19,7 +19,7 @@ export class AbicoderPragma extends SlangNode {
1919
this.updateMetadata(this.version);
2020
}
2121

22-
print(path: AstPath<AbicoderPragma>, print: PrintFunction): Doc {
22+
print(print: PrintFunction): Doc {
2323
return ['abicoder ', print('version')];
2424
}
2525
}

src/slang-nodes/AdditiveExpression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export class AdditiveExpression extends SlangNode {
5757
}
5858

5959
print(
60-
path: AstPath<AdditiveExpression>,
6160
print: PrintFunction,
61+
path: AstPath<AdditiveExpression>,
6262
options: ParserOptions<PrintableNode>
6363
): Doc {
6464
return printAdditiveExpression(this, path, print, options);

src/slang-nodes/AndExpression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export class AndExpression extends SlangNode {
3737
}
3838

3939
print(
40-
path: AstPath<AndExpression>,
4140
print: PrintFunction,
41+
path: AstPath<AndExpression>,
4242
options: ParserOptions<PrintableNode>
4343
): Doc {
4444
return printLogicalOperation(this, path, print, options);

src/slang-nodes/ArrayExpression.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SlangNode } from './SlangNode.js';
33
import { ArrayValues } from './ArrayValues.js';
44

55
import type * as ast from '@nomicfoundation/slang/ast';
6-
import type { AstPath, Doc, ParserOptions } from 'prettier';
6+
import type { Doc, ParserOptions } from 'prettier';
77
import type { CollectedMetadata, PrintFunction } from '../types.d.ts';
88
import type { PrintableNode } from './types.d.ts';
99

@@ -24,7 +24,7 @@ export class ArrayExpression extends SlangNode {
2424
this.updateMetadata(this.items);
2525
}
2626

27-
print(path: AstPath<ArrayExpression>, print: PrintFunction): Doc {
27+
print(print: PrintFunction): Doc {
2828
return ['[', print('items'), ']'];
2929
}
3030
}

src/slang-nodes/ArrayTypeName.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TypeName } from './TypeName.js';
55
import { Expression } from './Expression.js';
66

77
import type * as ast from '@nomicfoundation/slang/ast';
8-
import type { AstPath, Doc, ParserOptions } from 'prettier';
8+
import type { Doc, ParserOptions } from 'prettier';
99
import type { CollectedMetadata, PrintFunction } from '../types.d.ts';
1010
import type { PrintableNode } from './types.d.ts';
1111

@@ -35,7 +35,7 @@ export class ArrayTypeName extends SlangNode {
3535
this.updateMetadata(this.operand, this.index);
3636
}
3737

38-
print(path: AstPath<ArrayTypeName>, print: PrintFunction): Doc {
38+
print(print: PrintFunction): Doc {
3939
return [print('operand'), '[', print('index'), ']'];
4040
}
4141
}

src/slang-nodes/ArrayValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class ArrayValues extends SlangNode {
2626
);
2727
}
2828

29-
print(path: AstPath<ArrayValues>, print: PrintFunction): Doc {
29+
print(print: PrintFunction, path: AstPath<ArrayValues>): Doc {
3030
return printSeparatedList(path.map(print, 'items'));
3131
}
3232
}

src/slang-nodes/AssemblyFlags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class AssemblyFlags extends SlangNode {
2525
);
2626
}
2727

28-
print(path: AstPath<AssemblyFlags>, print: PrintFunction): Doc {
28+
print(print: PrintFunction, path: AstPath<AssemblyFlags>): Doc {
2929
return printSeparatedList(path.map(print, 'items'));
3030
}
3131
}

src/slang-nodes/AssemblyFlagsDeclaration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SlangNode } from './SlangNode.js';
33
import { AssemblyFlags } from './AssemblyFlags.js';
44

55
import type * as ast from '@nomicfoundation/slang/ast';
6-
import type { AstPath, Doc, ParserOptions } from 'prettier';
6+
import type { Doc, ParserOptions } from 'prettier';
77
import type { CollectedMetadata, PrintFunction } from '../types.d.ts';
88
import type { PrintableNode } from './types.d.ts';
99

@@ -24,7 +24,7 @@ export class AssemblyFlagsDeclaration extends SlangNode {
2424
this.updateMetadata(this.flags);
2525
}
2626

27-
print(path: AstPath<AssemblyFlagsDeclaration>, print: PrintFunction): Doc {
27+
print(print: PrintFunction): Doc {
2828
return ['(', print('flags'), ')'];
2929
}
3030
}

src/slang-nodes/AssemblyStatement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AssemblyFlagsDeclaration } from './AssemblyFlagsDeclaration.js';
66
import { YulBlock } from './YulBlock.js';
77

88
import type * as ast from '@nomicfoundation/slang/ast';
9-
import type { AstPath, Doc, ParserOptions } from 'prettier';
9+
import type { Doc, ParserOptions } from 'prettier';
1010
import type { CollectedMetadata, PrintFunction } from '../types.d.ts';
1111
import type { PrintableNode } from './types.d.ts';
1212

@@ -37,7 +37,7 @@ export class AssemblyStatement extends SlangNode {
3737
this.updateMetadata(this.label, this.flags, this.body);
3838
}
3939

40-
print(path: AstPath<AssemblyStatement>, print: PrintFunction): Doc {
40+
print(print: PrintFunction): Doc {
4141
return joinExisting(' ', [
4242
'assembly',
4343
print('label'),

src/slang-nodes/AssignmentExpression.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SlangNode } from './SlangNode.js';
55
import { Expression } from './Expression.js';
66

77
import type * as ast from '@nomicfoundation/slang/ast';
8-
import type { AstPath, Doc, ParserOptions } from 'prettier';
8+
import type { Doc, ParserOptions } from 'prettier';
99
import type { CollectedMetadata, PrintFunction } from '../types.d.ts';
1010
import type { PrintableNode } from './types.d.ts';
1111

@@ -36,7 +36,7 @@ export class AssignmentExpression extends SlangNode {
3636
this.updateMetadata(this.leftOperand, this.rightOperand);
3737
}
3838

39-
print(path: AstPath<AssignmentExpression>, print: PrintFunction): Doc {
39+
print(print: PrintFunction): Doc {
4040
return [
4141
print('leftOperand'),
4242
` ${this.operator}`,

0 commit comments

Comments
 (0)