In the API module, we're calling $statement->toString() to get the code for functions.

As compared to the 1.x branch, it appears that the 2.x branch is adding extra newlines to this result, at least when

$reader->setPreserveWhitespace(TRUE);

is being used.

Comments

jhodgdon’s picture

jhodgdon’s picture

Just a note... With preserve whitespace turned off, it seems to preserve the whitespace as it was, and work better.

solotandem’s picture

Category: bug » support

I have run the parser hundreds of times with all kinds of input and it matches exactly with the preserve whitespace setting enabled. Typically, before committing a change, I test the code against the Drupal core codebase (for 8.x including the Symfony code). It matches exactly, except for a handful of syntax formatting errors in the source code (which are corrected by the parser on rewrite).

Your basis for this issue is related to what you observed in the API module, but as noted in http://drupal.org/node/1713430#comment-6384592, the issue is not with the parser.

jhodgdon’s picture

Status: Active » Fixed

OK, well I have the API module working fine with the FALSE setting for preserve whitespace, so I'm not going to press the issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.