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

Comments in function arguments #8

Merged
1 commit merged into from
Oct 4, 2010
Merged

Comments in function arguments #8

1 commit merged into from
Oct 4, 2010

Conversation

mroch
Copy link

@mroch mroch commented Oct 4, 2010

Fixes a bug where something like this will break highlighting for the rest of the file:

function my_vararg_function($foo/*, ... */) {
   ...
}

The problem is that the syntax looks for $foo followed by a comma or closing paren and does not allow a comment.

@joshvarner
Copy link
Contributor

I believe this particular issue was fixed already in 1720dbc, and then a related issue was fixed in c2c2212. Perhaps the bundle you had been using had not been updated when you noticed this issue?

Please check out the latest in the official fork and see if you still see the issue. I'll leave the pull request open in the meantime, to make sure this is fixed for you.

@mroch
Copy link
Author

mroch commented Oct 4, 2010

Thanks for the quick response.

I did test this on the latest. The two commits you mention seem to fix the same problem for the case where last argument is typehinted (note how meta.function.argument.typehinted.php's end regex contains /[/*]|\# but the others don't), and when the comment comes before the argument (which the multi-line case collapses to when you remove whitespace).

@joshvarner
Copy link
Contributor

Ah, okay. I understand now. I've merged/pushed your commit. I also noticed another potential usage that would break things:

function foo(array $bar = array(1, 2, /* test */ 3)) {}

I pushed 4820322 to fix that as well. Let me know how it works for you. Thanks for the patch!

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

Successfully merging this pull request may close these issues.

2 participants