Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Nov 8, 2023
1 parent f88e8e5 commit 49fa93e
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions packages/core/src/utils/make-namespaced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function makeNamespacedInput(input: SolcInput, output: SolcOutput): SolcI

for (const node of output.sources[sourcePath].ast.nodes) {
switch (node.nodeType) {
case 'ContractDefinition':
case 'ContractDefinition': {
const contractDef = node;

// Remove any calls to parent constructors from the inheritance list
Expand All @@ -59,21 +59,21 @@ export function makeNamespacedInput(input: SolcInput, output: SolcOutput): SolcI

const contractNodes = contractDef.nodes;
for (const contractNode of contractNodes) {
switch(contractNode.nodeType) {
switch (contractNode.nodeType) {
case 'FunctionDefinition':
case 'ModifierDefinition':
case 'VariableDeclaration':
case 'VariableDeclaration': {
if (contractNode.documentation) {
modifications.push(makeDelete(contractNode.documentation, orig));
}
modifications.push(makeDelete(contractNode, orig));
break;

case 'UsingForDirective':
}
case 'UsingForDirective': {
modifications.push(makeDelete(contractNode, orig));
break;

case 'StructDefinition':
}
case 'StructDefinition': {
const storageLocation = getStorageLocationAnnotation(contractNode);
if (storageLocation !== undefined) {
const structName = contractNode.name;
Expand All @@ -83,30 +83,33 @@ export function makeNamespacedInput(input: SolcInput, output: SolcOutput): SolcI
modifications.push(makeInsertAfter(contractNode, insertText));
}
break;

}
case 'EnumDefinition':
case 'ErrorDefinition':
case 'EventDefinition':
case 'UserDefinedValueTypeDefinition':
case 'UserDefinedValueTypeDefinition': {
// nothing
break;
}
}
}
break;

}
case 'FunctionDefinition':
case 'UsingForDirective':
case 'VariableDeclaration':
case 'VariableDeclaration': {
modifications.push(makeDelete(node, orig));
break;

}
case 'EnumDefinition':
case 'ErrorDefinition':
case 'ImportDirective':
case 'PragmaDirective':
case 'StructDefinition':
case 'UserDefinedValueTypeDefinition':
case 'UserDefinedValueTypeDefinition': {
// nothing
break;
}
}
}

Expand Down

0 comments on commit 49fa93e

Please sign in to comment.