Skip to content

Commit

Permalink
fix: multiple spaces after tags
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Jan 9, 2024
1 parent da2b9d6 commit dee4f26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sample-data/BasicSample.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract BasicSample {
/**
* @notice External function that returns a bool
* @dev A dev comment
* @param _magicNumber A parameter description
* @param _magicNumber A parameter description
* @param _name Another parameter description
* @return _isMagic Some return data
*/
Expand Down
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export function parseNodeNatspec(node: SolcContractNode): Natspec {
result.inheritdoc = { content: tagMatch[2] };
}
} else if (tagName === 'param' || tagName === 'return') {
const tagMatch = line.match(/^\s*@(\w+) (\w+) (.*)$/);
const tagMatch = line.match(/^\s*@(\w+) +(\w+) (.*)$/);
if (tagMatch) {
currentTag = { name: tagMatch[2], content: tagMatch[3].trim() };
result[tagName === 'param' ? 'params' : 'returns'].push(currentTag);
}
} else {
const tagMatch = line.match(/^\s*@(\w+) (.*)$/);
const tagMatch = line.match(/^\s*@(\w+) +(.*)$/);
if (tagMatch) {
currentTag = { name: tagName, content: tagMatch[2] };
result.tags.push(currentTag);
Expand Down

0 comments on commit dee4f26

Please sign in to comment.