Skip to content

Commit 644f2bc

Browse files
committed
handle require/type
1 parent bc7f80a commit 644f2bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SolidityStatement {
6565
if (scope) {
6666
this.scope = scope;
6767
} else {
68-
if (['function ', 'modifier ', 'mapping ', 'event ', 'error '].some(e => this.rawCommand.startsWith(e))) {
68+
if (['function ', 'modifier ', 'mapping ', 'event ', 'error ', 'type '].some(e => this.rawCommand.startsWith(e))) {
6969
this.scope = SCOPE.CONTRACT;
7070
this.hasNoReturnValue = true;
7171
} else if (this.rawCommand.startsWith('pragma solidity ')) {
@@ -76,7 +76,7 @@ class SolidityStatement {
7676
this.scope = SCOPE.SOURCE_UNIT;
7777
this.hasNoReturnValue = true;
7878
this.rawCommand = this.fixStatement(this.rawCommand);
79-
} else if (['contract ', 'interface ', 'struct ', 'enum '].some(e => this.rawCommand.startsWith(e))) {
79+
} else if (['contract ', 'interface ', 'abstract', 'library', 'struct ', 'enum '].some(e => this.rawCommand.startsWith(e))) {
8080
this.scope = SCOPE.SOURCE_UNIT;
8181
this.hasNoReturnValue = true;
8282
} else {

0 commit comments

Comments
 (0)