Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function truncated #2

Open
valerio-bozzolan opened this issue Feb 16, 2017 · 1 comment
Open

Function truncated #2

valerio-bozzolan opened this issue Feb 16, 2017 · 1 comment
Labels

Comments

@valerio-bozzolan
Copy link

valerio-bozzolan commented Feb 16, 2017

Try with this PHP function:

/***
*/
function a($b = "/") {
}

I think that the / brokes the parser, because you obtain:

# Documentation
## `function a($b = "`
@ocram ocram added the bug label Feb 17, 2017
@ocram
Copy link
Contributor

ocram commented Feb 17, 2017

Thanks a lot!

This is due to the regular expression

/\/\*\*([^]*?)\*\/([^{;/]+)/gm

in this line which extracts annotated symbols along with their doc comments.

The three delimiters {, ; and / (the latter probably due to usage in comments) have been chosen to mark the end of symbols, such as variable or function declarations.

Unfortunately, if any of these three symbols appears in your symbol, e.g. in a variable name (if possible) or in the signature of the function, the symbol will be cut off at that point.

Maybe we won't be able to solve that problem with (this) regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants