[ phpeclipse-Bugs-1477978 ] DEFINE is not parset correctly

"SourceForge.net" <[email protected]> Thu, 10 May 2007 15:32:45 -0700
Newsgroups gmane.comp.ide.eclipse.phpeclipse.devel
Message-ID <[email protected]>
Bugs item #1477978, was opened at 2006-04-27 15:53
Message generated for change (Comment added) made by emann
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1477978&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 Parser 
Group: None
Status: Open
Resolution: None
>Priority: 5
Private: No
Submitted By: Hertzel (emudojo)
>Assigned to: Edward Mann (emann)
Summary: DEFINE is not parset correctly

Initial Comment:
When you have some code like this

define('MAX_CONNECTION_STATUS_IGNORE',      1);
    define('MAX_CONNECTION_STATUS_PENDING',     2);
    define('MAX_CONNECTION_STATUS_ONHOLD',      3);
    define('MAX_CONNECTION_STATUS_APPROVED',    4);
    define('MAX_CONNECTION_STATUS_DISAPPROVED', 5);
    define('MAX_CONNECTION_STATUS_DUPLICATE',   6);

  
    $GLOBALS['_MAX']['STATUSES'] = array(
        MAX_CONNECTION_STATUS_IGNORE      =>
'strStatusIgnore',       // start value
        MAX_CONNECTION_STATUS_PENDING     =>
'strStatusPending',      // start value
        MAX_CONNECTION_STATUS_ONHOLD      =>
'strStatusOnHold',
        MAX_CONNECTION_STATUS_APPROVED    =>
'strStatusApproved',     // start value
        MAX_CONNECTION_STATUS_DISAPPROVED =>
'strStatusDisapproved',
        MAX_CONNECTION_STATUS_DUPLICATE   =>
'strStatusDuplicate',
    );

PHPeclipse underline the keys of the
$GLOBALS['_MAX']['STATUSES'] array, because for
Phpeclipse those GLOBAL variables haven't been
initialized. I have in my include path the folder
containing this file.

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

>Comment By: Edward Mann (emann)
Date: 2007-05-10 17:32

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

Hertzel,

Can you please give me a version on what you are using PHPEclipse and
Eclipse. I was not able to reproduce on PHPEclipse 1.1.8

Thanks.

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

Comment By: Pablo Aguiar (scorphus)
Date: 2007-03-23 12:05

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

I don't confirm this bug. I unsuccessfully tried to reproduce it with this
three different approaches:

Approach one:
[file="1477978_test_01.php"]
<?php
define('MAX_CONNECTION_STATUS_IGNORE', 1);
define('MAX_CONNECTION_STATUS_PENDING', 2);
define('MAX_CONNECTION_STATUS_ONHOLD', 3);
define('MAX_CONNECTION_STATUS_APPROVED', 4);
define('MAX_CONNECTION_STATUS_DISAPPROVED', 5);
define('MAX_CONNECTION_STATUS_DUPLICATE', 6);
$GLOBALS['_MAX']['STATUSES'] = array(
  MAX_CONNECTION_STATUS_IGNORE => 'strStatusIgnore', // start value
  MAX_CONNECTION_STATUS_PENDING => 'strStatusPending', // start value
  MAX_CONNECTION_STATUS_ONHOLD => 'strStatusOnHold',
  MAX_CONNECTION_STATUS_APPROVED => 'strStatusApproved', // start value
  MAX_CONNECTION_STATUS_DISAPPROVED => 'strStatusDisapproved',
  MAX_CONNECTION_STATUS_DUPLICATE => 'strStatusDuplicate',
);
?>
[/file]

Approach two:
[file="1477978_test_02-a.php"]
<?php
define('MAX_CONNECTION_STATUS_IGNORE', 1);
define('MAX_CONNECTION_STATUS_PENDING', 2);
define('MAX_CONNECTION_STATUS_ONHOLD', 3);
define('MAX_CONNECTION_STATUS_APPROVED', 4);
define('MAX_CONNECTION_STATUS_DISAPPROVED', 5);
define('MAX_CONNECTION_STATUS_DUPLICATE', 6);
?>
[/file]
[file="1477978_test_02-b.php"]
<?php
require_once '1477978_test_02-a.php';
$GLOBALS['_MAX']['STATUSES'] = array(
  MAX_CONNECTION_STATUS_IGNORE => 'strStatusIgnore', // start value
  MAX_CONNECTION_STATUS_PENDING => 'strStatusPending', // start value
  MAX_CONNECTION_STATUS_ONHOLD => 'strStatusOnHold',
  MAX_CONNECTION_STATUS_APPROVED => 'strStatusApproved', // start value
  MAX_CONNECTION_STATUS_DISAPPROVED => 'strStatusDisapproved',
  MAX_CONNECTION_STATUS_DUPLICATE => 'strStatusDuplicate',
);
?>
[/file]

Approach three:
[file="1477978_test_03.php"]
<?php
define(MAX_CONNECTION_STATUS_IGNORE, 1);
define(MAX_CONNECTION_STATUS_PENDING, 2);
define(MAX_CONNECTION_STATUS_ONHOLD, 3);
define(MAX_CONNECTION_STATUS_APPROVED, 4);
define(MAX_CONNECTION_STATUS_DISAPPROVED, 5);
define(MAX_CONNECTION_STATUS_DUPLICATE, 6);
$GLOBALS['_MAX']['STATUSES'] = array(
  MAX_CONNECTION_STATUS_IGNORE => 'strStatusIgnore', // start value
  MAX_CONNECTION_STATUS_PENDING => 'strStatusPending', // start value
  MAX_CONNECTION_STATUS_ONHOLD => 'strStatusOnHold',
  MAX_CONNECTION_STATUS_APPROVED => 'strStatusApproved', // start value
  MAX_CONNECTION_STATUS_DISAPPROVED => 'strStatusDisapproved',
  MAX_CONNECTION_STATUS_DUPLICATE => 'strStatusDuplicate',
);
?>
[/file]

For all these tests, all files were parsed correctly and no error nor
warning arose.

I'm using Eclipse 3.2.1 and phpeclipse-1.1.9-cvs-20060920

Regards,
Pablo Aguiar.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1477978&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/