kphp icon indicating copy to clipboard operation
kphp copied to clipboard

Allow trailing comma for function use and parameter lists

Open mkornaukhov opened this issue 3 years ago • 2 comments

Support PHP8 feature. Main issue: https://github.com/VKCOM/kphp/issues/290 Previous attempt: https://github.com/VKCOM/kphp/pull/308 I didn't rebase because of merge conflict.

mkornaukhov avatar Oct 31 '22 22:10 mkornaukhov

Hi!

I would suggest adding the tests.

  1. One test should fail for the incorrect syntax combinations. Two trailing commas, etc. See @kphp-should-fail annotations in tests/phpt/
  2. Another test should check that trailing commas work as expected (@ok test).

Basically, this feature should work when it works in PHP and fail to compile when it's not a valid syntax for PHP. You may look at the PHP pull request for an inspiration. It probably includes some tests.

See the docs for more info about contributing (how to run tests, etc.)

Or you can ask the questions here. For Russian-speaking contributors I would suggest a Telegram chat: https://t.me/kphp_chat

quasilyte avatar Nov 02 '22 20:11 quasilyte

Please check

mkornaukhov avatar Nov 28 '22 08:11 mkornaukhov