@@ -3,7 +3,7 @@ import { coerce, satisfies } from 'semver';
33import { NonterminalKind } from '@nomicfoundation/slang/cst' ;
44import { getNodeMetadata , updateMetadata } from '../slang-utils/metadata.js' ;
55import { Identifier } from './Identifier.js' ;
6- import { InheritanceSpecifier } from './InheritanceSpecifier .js' ;
6+ import { ContractSpecifiers } from './ContractSpecifiers .js' ;
77import { ContractMembers } from './ContractMembers.js' ;
88
99import type * as ast from '@nomicfoundation/slang/ast' ;
@@ -24,7 +24,7 @@ export class ContractDefinition implements SlangNode {
2424
2525 name : Identifier ;
2626
27- inheritance ?: InheritanceSpecifier ;
27+ specifiers : ContractSpecifiers ;
2828
2929 members : ContractMembers ;
3030
@@ -33,12 +33,10 @@ export class ContractDefinition implements SlangNode {
3333
3434 this . abstractKeyword = ast . abstractKeyword ?. unparse ( ) ;
3535 this . name = new Identifier ( ast . name ) ;
36- if ( ast . inheritance ) {
37- this . inheritance = new InheritanceSpecifier ( ast . inheritance , options ) ;
38- }
36+ this . specifiers = new ContractSpecifiers ( ast . specifiers , options ) ;
3937 this . members = new ContractMembers ( ast . members , options ) ;
4038
41- metadata = updateMetadata ( metadata , [ this . inheritance , this . members ] ) ;
39+ metadata = updateMetadata ( metadata , [ this . specifiers , this . members ] ) ;
4240
4341 this . comments = metadata . comments ;
4442 this . loc = metadata . loc ;
@@ -68,7 +66,8 @@ export class ContractDefinition implements SlangNode {
6866 this . abstractKeyword ? 'abstract ' : '' ,
6967 'contract ' ,
7068 path . call ( print , 'name' ) ,
71- this . inheritance ? [ ' ' , path . call ( print , 'inheritance' ) ] : line ,
69+ path . call ( print , 'specifiers' ) ,
70+ this . specifiers . items . length > 0 ? '' : line ,
7271 '{'
7372 ] ) ,
7473 path . call ( print , 'members' ) ,
0 commit comments