Closed (fixed)
Project:
Grammar Parser
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2012 at 17:13 UTC
Updated:
6 Sep 2012 at 21:41 UTC
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
Comment #1
jhodgdonSee also
http://drupal.org/node/1713430#comment-6383694
Comment #2
jhodgdonJust a note... With preserve whitespace turned off, it seems to preserve the whitespace as it was, and work better.
Comment #3
solotandem commentedI 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.
Comment #4
jhodgdonOK, well I have the API module working fine with the FALSE setting for preserve whitespace, so I'm not going to press the issue.