[ phpeclipse-Bugs-1475484 ] code formatter: bad result for array() embedding func calls

"SourceForge.net" <[email protected]> Sun, 06 May 2007 19:20:04 -0700
Newsgroups gmane.comp.ide.eclipse.phpeclipse.devel
Message-ID <[email protected]>
Bugs item #1475484, was opened at 2006-04-24 05:01
Message generated for change (Comment added) made by sf-robot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1475484&group_id=57621

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: PHP Editor
Group: None
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Michel D'HOOGE (mdhooge)
Assigned to: Nobody/Anonymous (nobody)
Summary: code formatter: bad result for array() embedding func calls

Initial Comment:
When I ask to reformat the following expression:
$example = array(substr('abcdef', 2), substr('zyxw', 
2));

I get this result:
$example = array (
  substr('abcdef',
  2
), substr('zyxw', 2));

While I would expect this one:
$example = array (
  substr('abcdef', 2),
  substr('zyxw', 2)
);

Analysis: The code formatter ignores opening 
parentheses when looking for commas. And the first 
closing parenthese is used to close the array.

----------------------------------------------------------------------

>Comment By: SourceForge Robot (sf-robot)
Date: 2007-05-06 19:20

Message:
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

----------------------------------------------------------------------

Comment By: Toshihiro (toshihiro)
Date: 2007-04-03 22:59

Message:
Logged In: YES 
user_id=1527096
Originator: NO

Fixed in CVS.


----------------------------------------------------------------------

Comment By: Michel D'HOOGE (mdhooge)
Date: 2006-06-12 03:24

Message:
Logged In: YES 
user_id=166420

Formatting the following array definition:
$datasource_options = array (
    //'formbuilder_integration' => true
);

gives the result:
$datasource_options = array (
//'formbuilder_integration' => true);

which is totally wrong since the closing parenthesis is now
in the comment.

----------------------------------------------------------------------

Comment By: Martin Domanski (adie)
Date: 2006-06-02 04:23

Message:
Logged In: YES 
user_id=947582

Here another example:
/****SOURCE*****/
$primaryFields = array (
	array (
		'title' => $tran->getLabel(3147),		
		'value' => $oferta['numer_oferty']
	), 
	array (
		'title' => $tran->getLabel(54),
		'value' => $lokalicazja['gmina']
	), 
	array (
		'title' => $tran->getLabel(55),
		'value' => $lokalizacja['miejscowosc']
	)
);
/****RESULT********/
$primaryFields = array (
	array (
		'title' => $tran->getLabel(3147
	),
	'value' => $oferta['numer_oferty']
), array (
	'title' => $tran->getLabel(54
), 'value' => $lokalicazja['gmina']), array (
	'title' => $tran->getLabel(55
), 'value' => $lokalizacja['miejscowosc']));



----------------------------------------------------------------------

Comment By: Michel D'HOOGE (mdhooge)
Date: 2006-05-11 04:16

Message:
Logged In: YES 
user_id=166420

I tested the following java code that is more or less
equivalent and the result is correct. So maybe it is not too
difficult to correct this...

public class Test {
  public int[] arraydfsd = { 1, 2, 3, test(45, 67, 89) };

  public static int test(int a, int b, int c) {
    return a + b + c;
  }
}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1475484&group_id=57621

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/