[Bug 224738] New: Syntax Error indication when closing parenthesis missing in php if statment

  • From:
  • To:
  • Subject: [Bug 224738] New: Syntax Error indication when closing parenthesis missing in php if statment
  • Date: Fri, 11 Jan 2013 06:18:28 +0000
  • Auto-submitted: auto-generated

http://netbeans.org/bugzilla/show_bug.cgi?id=224738

             Bug #: 224738
        Issue Type: DEFECT
           Summary: Syntax Error indication when closing parenthesis
                    missing in php if statment
    Classification: Unclassified
           Product: editor
           Version: 7.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Priority: P3
         Component: Hints & Annotations
        AssignedTo: 

        ReportedBy: 

         QAContact: 



Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Linux version 3.0.0-29-generic-pae running on i386
Java; VM; Vendor = 1.6.0_24
Runtime = OpenJDK Client VM 20.0-b12

[Product] and [Component] may be wrong above, pls fix as necessary!

Sample code:
<?php

$a = 1;

// case A: simple if using { }, error shows on if line
if (empty($a)) {
    ;
}

// case B: if then else using { }, error shows on first closing } line
if (empty($a)) {
    ;
}
else {
    ;
}

// case C: simple if without { }, error shows on if line
if (empty($a))
    ;

// case D: if then else without { }, error shows on first ; line
if (empty($a))
    ;
else
    ;
?>

In each case A through D, remove the second closing parenthesis on the if
statement and observe where the error is reported:

A and C are the same, on the "if" line

D places it at the first "then" line

B places it at the end of the "then" { } block

Case B especially has bitten me many times, having me check opening and 
closing
bracket balance before realising ..

It makes no difference if the "then" lines are just a ; as shown, or not.

-- 
Configure bugmail: http://netbeans.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


[Bug 224738] New: Syntax Error indication when closing parenthesis missing in php if statment

berniev 01/11/2013

[Bug 224738] Syntax Error indication when closing parenthesis missing in php if statment

jlahoda 01/11/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close