Skip to content

Commit a5440d5

Browse files
authored
Fixing a bug for function definition
The function defintion should start one posiiton after the end of the modifier. Given a function "function method() onlyOwner {...}', the current version of the return the definition "r{...}" instead of "{...}". I notice the same error happens when a function uses a modifier: the last character of the modifier is added to the parsed definiton. This commit fixes the bug.
1 parent 3c0f3a5 commit a5440d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/registrar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ class Registrar {
115115
// which contains an open curly brace. Skip ahead...
116116
if (expression.modifiers && expression.modifiers.length){
117117
for (let modifier of expression.modifiers ){
118-
if (modifier.range[1] > start){
119-
start = modifier.range[1];
118+
if (modifier.range[1]+1 > start){
119+
start = modifier.range[1]+1;
120120
}
121121
}
122122
} else {

0 commit comments

Comments
 (0)