This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The following are accepted when tested in PHP 5.2.4, but will be reported as errors inside the IDE editor. array(1, 2, 3,); switch(i) { case ' '; case '.'; //... } Product Version: NetBeans IDE Dev (Build 200711160000) Java: 1.6.0_10-ea; Java HotSpot(TM) Client VM 1.6.0_10-ea-b07 System: Windows Vista version 6.0 running on x86; Cp1252; en_GB (nb)
Partial fix for first problem ( "array" function ) : RCS file: /cvs/scripting/php/srcmodel/test/unit/src/org/netbeans/modules/php/model/ArrayTest.java,v done Checking in php/srcmodel/test/unit/src/org/netbeans/modules/php/model/ArrayTest.java; /cvs/scripting/php/srcmodel/test/unit/src/org/netbeans/modules/php/model/ArrayTest.java,v <-- ArrayTest.java initial revision: 1.1 done Checking in php/editing/src/org/netbeans/modules/languages/php/resources/purePHP5.nbs; /cvs/scripting/php/editing/src/org/netbeans/modules/languages/php/resources/purePHP5.nbs,v <-- purePHP5.nbs new revision: 1.58; previous revision: 1.57 done Checking in php/srcmodel/test/unit/src/org/netbeans/modules/php/model/resources/ResourceMarker.java; /cvs/scripting/php/srcmodel/test/unit/src/org/netbeans/modules/php/model/resources/ResourceMarker.java,v <-- ResourceMarker.java new revision: 1.11; previous revision: 1.10 done RCS file: /cvs/scripting/php/srcmodel/test/unit/src/org/netbeans/modules/php/model/resources/array.php,v done Checking in php/srcmodel/test/unit/src/org/netbeans/modules/php/model/resources/array.php; /cvs/scripting/php/srcmodel/test/unit/src/org/netbeans/modules/php/model/resources/array.php,v <-- array.php initial revision: 1.1 done The was previous fixes for "array" function but either they was incorrect or "languages" module implementation was changed and they don't work currently. The problem in "nbs" file that doesn't provide good possibility to write correct grammar construction for "array". I choose approach with not exact grammar construction. Current grammar construction recognizes "array" usage as correct when it is incorrect . This behavior will be fixed later when manual error detection will be written.
Switch construction is actually corner case: such construction are not described in PHP manual and this is like "hack" possibility that is not disabled in PHP language. Each "case" should be paired token ":" by language description. And I don't see any indication about correctness of represented construction. But it is really recognized by parser. So we need somehow to remove errors.
Fix for switch : Checking in php/editing/src/org/netbeans/modules/languages/php/resources/purePHP5.nbs; /cvs/scripting/php/editing/src/org/netbeans/modules/languages/php/resources/purePHP5.nbs,v <-- purePHP5.nbs new revision: 1.59; previous revision: 1.58 done
Fixed.
Verified - Thanks. Product Version: NetBeans IDE Dev (Build 200711191200) Java: 1.6.0_10-ea; Java HotSpot(TM) Client VM 1.6.0_10-ea-b07 System: Windows Vista version 6.0 running on x86; Cp1252; en_GB (nb)
By the way, the fix for array initialisation syntax might have caused #122565