Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Lexer/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private function generateRegexp(): string

self::TOKEN_OPEN_PHPDOC => '/\\*\\*(?=\\s)\\x20?+',
self::TOKEN_CLOSE_PHPDOC => '\\*/',
self::TOKEN_PHPDOC_TAG => '@[a-z][a-z0-9-\\\\]*+',
self::TOKEN_PHPDOC_TAG => '@(?:[a-z][a-z0-9-\\\\]+:)?[a-z][a-z0-9-\\\\]*+',
self::TOKEN_PHPDOC_EOL => '\\r?+\\n[\\x09\\x20]*+(?:\\*(?!/)\\x20?+)?',

self::TOKEN_FLOAT => '(?:-?[0-9]++\\.[0-9]*+(?:e-?[0-9]++)?)|(?:-?[0-9]*+\\.[0-9]++(?:e-?[0-9]++)?)|(?:-?[0-9]++e-?[0-9]++)',
Expand Down
17 changes: 17 additions & 0 deletions tests/PHPStan/Parser/PhpDocParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected function setUp(): void

/**
* @dataProvider provideTagsWithNumbers
* @dataProvider provideSpecializedTags
* @dataProvider provideParamTagsData
* @dataProvider provideTypelessParamTagsData
* @dataProvider provideVarTagsData
Expand Down Expand Up @@ -4851,6 +4852,22 @@ public function provideParamOutTagsData(): Iterator
];
}

public function provideSpecializedTags(): Iterator
{
yield [
'Ok specialized tag',
'/** @special:param this is special */',
new PhpDocNode([
new PhpDocTagNode(
'@special:param',
new GenericTagValueNode(
'this is special'
)
),
]),
];
}

/**
* @dataProvider dataParseTagValue
* @param PhpDocNode $expectedPhpDocNode
Expand Down