Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 4973559

Browse files
authored
fix: multiple spaces after tags (#3)
* fix: multiple spaces after tags * fix: allow multiple spaces
1 parent 2eea664 commit 4973559

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sample-data/BasicSample.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ contract BasicSample {
1111
/**
1212
* @notice External function that returns a bool
1313
* @dev A dev comment
14-
* @param _magicNumber A parameter description
14+
* @param _magicNumber A parameter description
1515
* @param _name Another parameter description
1616
* @return _isMagic Some return data
1717
*/
@@ -42,7 +42,7 @@ contract BasicSample {
4242
* @notice External function that returns a bool
4343
* @dev A dev comment
4444
* @param _magicNumber A parameter description
45-
* @param _name Another parameter description
45+
* @param _name Another parameter description
4646
* @return _isMagic Some return data
4747
* @return Test test
4848
*/

src/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export function parseNodeNatspec(node: SolcContractNode): Natspec {
2727
result.inheritdoc = { content: tagMatch[2] };
2828
}
2929
} else if (tagName === 'param' || tagName === 'return') {
30-
const tagMatch = line.match(/^\s*@(\w+) (\w+) (.*)$/);
30+
const tagMatch = line.match(/^\s*@(\w+) *(\w+) (.*)$/);
3131
if (tagMatch) {
3232
currentTag = { name: tagMatch[2], content: tagMatch[3].trim() };
3333
result[tagName === 'param' ? 'params' : 'returns'].push(currentTag);
3434
}
3535
} else {
36-
const tagMatch = line.match(/^\s*@(\w+) (.*)$/);
36+
const tagMatch = line.match(/^\s*@(\w+) *(.*)$/);
3737
if (tagMatch) {
3838
currentTag = { name: tagName, content: tagMatch[2] };
3939
result.tags.push(currentTag);

0 commit comments

Comments
 (0)