prettier-plugin-solidity
Version:
A Prettier Plugin for automatically formatting your Solidity code.
21 lines • 857 B
JavaScript
import { NonterminalKind } from '@nomicfoundation/slang/cst';
import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js';
import { IdentifierPath } from './IdentifierPath.js';
import { UsingAlias } from './UsingAlias.js';
export class UsingDeconstructionSymbol {
constructor(ast) {
this.kind = NonterminalKind.UsingDeconstructionSymbol;
let metadata = getNodeMetadata(ast);
this.name = new IdentifierPath(ast.name);
if (ast.alias) {
this.alias = new UsingAlias(ast.alias);
}
metadata = updateMetadata(metadata, [this.name, this.alias]);
this.comments = metadata.comments;
this.loc = metadata.loc;
}
print(path, print) {
return [path.call(print, 'name'), path.call(print, 'alias')];
}
}
//# sourceMappingURL=UsingDeconstructionSymbol.js.map