Fix comment reformatting on Linux

Remove the use of \R (with BSR_ANYCRLF) at two places, as it was causing
problems there.
This commit is contained in:
nikic 2012-05-11 18:45:55 +02:00
parent cc4b8761e4
commit dab2fd4b7a
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,9 @@
Version 0.9.2-dev Version 0.9.2-dev
----------------- -----------------
* [BC] Due to the below changes nodes now optionally accept an `$attributes` array as the
last parameter, instead of the previously used `$line` and `$docComment` parameters.
* Add mechanism for adding attributes to nodes in the lexer. * Add mechanism for adding attributes to nodes in the lexer.
The following attributes are now added by default: The following attributes are now added by default:

View File

@ -65,9 +65,7 @@ class PHPParser_Comment
// //
// is handled by replacing the whitespace sequences before the * by a single space // is handled by replacing the whitespace sequences before the * by a single space
return preg_replace('(^\s+\*)m', ' *', $this->text); return preg_replace('(^\s+\*)m', ' *', $this->text);
} elseif (preg_match('((*BSR_ANYCRLF)^/\*\*?\s\R)', $text) } elseif (preg_match('(^/\*\*?\s*[\r\n])', $text) && preg_match('(\n(\s*)\*/$)', $text, $matches)) {
&& preg_match('((*BSR_ANYCRLF)\R(\s*)\*/$)', $text, $matches)
) {
// Multi line comment of the type // Multi line comment of the type
// //
// /* // /*