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.
Summary: | Syntax Error indication when closing parenthesis missing in php if statment | ||
---|---|---|---|
Product: | php | Reporter: | berniev |
Component: | Editor | Assignee: | Ondrej Brejla <obrejla> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | amobilia, kanakmar |
Priority: | P4 | ||
Version: | 7.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
berniev
2013-01-11 06:18:28 UTC
Works properly for me in 7.2.1 and 7.3dev. No errors shown. Martine, can you confirm that? Thanks in advance. Also works for me. I try it in 7.3 dev build, 7.2.1 and also 7.2. In each of them error message doesn't show up. Huh? Did you read .... "In each case A through D, remove the second closing parenthesis on the if statement and observe where the error is reported" Here it is again, ~~parenthesis removed~~ <?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 ; ?> I didn't want cases cross polluting, but is the same. Also tested 7.3beta2 Ok, errors are shown... So I don't know, what is a problem...that the errors are not self-explanatory? So you think that error messages and places (underlined chars) should be improved? Definitely yes, but it's P4 defect, or P3 enhancement. Nothing is broken and everything works as it's intended for now (parser and error handler are written to work this way). Thanks for catching that. The ~same~ error, in ~four~ similar code variants, gives ~three~ different error positions. So there is inconsistency, which surely is not intended. The result in Case B in the example is misleading, dare I say just plain wrong, often being far from the source of the problem. I don't know .. is there a situation where "if (empty($a) {" is legal? Thank you for your attention. Hi, This doesn't occurs anymore on the 8.2 rc version (dev 201609210002) : - the if line is displayed in error if the { is present - the ; is displayed in error on the two last cases (netbeans search for a closing parenthis and found a ; ) Feel free to reopen the ticket if the problem isn't solved on your configuration. Regards |