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

Compatability with php-parser 3.0 #17

Open
nekosaur opened this issue Oct 24, 2018 · 2 comments
Open

Compatability with php-parser 3.0 #17

nekosaur opened this issue Oct 24, 2018 · 2 comments

Comments

@nekosaur
Copy link

It looks like there are some breaking changes in the coming php-parser 3.0 that results in php-unparser being unable to use its output to unparse. Specifically I had problems with simple string arrays.

<?

return [
  "xzczxc",
  "qweqweqwe"
];
Node: xzczxc
Node kind: undefined
{ Error: Bad AST structure
    at CodeGen.process (/home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/index.js:42:13)
    at /home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/array.js:11:19
    at Array.map (<anonymous>)
    at CodeGen.module.exports [as array] (/home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/array.js:19:25)
    at CodeGen.process (/home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/index.js:32:31)
    at /home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/array.js:11:19
    at Array.map (<anonymous>)
    at CodeGen.module.exports [as array] (/home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/array.js:19:25)
    at CodeGen.process (/home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/index.js:32:31)
    at CodeGen.module.exports [as return] (/home/vagrant/apps/translation-scripts/node_modules/php-unparser/node_translators/return.js:12:22) node: 'xzczxc' }
@chris-l
Copy link
Owner

chris-l commented Oct 24, 2018

Well, yes. I haven't seen the new parser yet, but for what @ichiriac said on his issues, it seemed like the changes he was planning to do would completely break the unparser on its current state.

@ichiriac
Copy link
Contributor

Hi, yes actually v3 will not be backward compatible, but changes should be enough simple to implement. Remains some changes to implement before the v3 will be fully released and then I'll write a migration guide and send a PR on this project.

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

No branches or pull requests

3 participants