Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
apanichella authored Mar 26, 2021
commit a5440d59059e1856de342dc5eb58c79a06254939
4 changes: 2 additions & 2 deletions lib/registrar.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class Registrar {
// which contains an open curly brace. Skip ahead...
if (expression.modifiers && expression.modifiers.length){
for (let modifier of expression.modifiers ){
if (modifier.range[1] > start){
start = modifier.range[1];
if (modifier.range[1]+1 > start){
start = modifier.range[1]+1;
}
}
} else {
Expand Down