Skip to content

Commit

Permalink
Fix: const in a function name was parsed as modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Gautier committed Nov 19, 2019
1 parent 30c808f commit 7f2e23f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions betty-doc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2804,8 +2804,8 @@ ($)
(?:\s+$Modifier|\s+const)*
}x;
our $Type = qr{
$NonptrType
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)?
$NonptrType\b
(?:(?:\s|\*|\[\])+\s*const\b|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)?
(?:\s+$Inline|\s+$Modifier)*
}x;

Expand Down
25 changes: 25 additions & 0 deletions tests/doc/doc14.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* constructor - Test function
*
* @path: Hello
* @test: World
*
* Return: 0
*/
int constructor(char **path, int test)
{
return (0);
}

/**
* ructor - Test function
*
* @path: Hello
* @test: World
*
* Return: 0
*/
int constructor(char **path, int test)
{
return (0);
}
1 change: 1 addition & 0 deletions tests/doc/doc14.expected.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/doc/doc14.c:22: warning: no description found for function constructor
2 changes: 2 additions & 0 deletions tests/doc/doc14.expected.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
constructor
constructor

0 comments on commit 7f2e23f

Please sign in to comment.