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.
Product Version: NetBeans IDE Dev (Build 071030) Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105 System: Linux version 2.6.17-12-generic running on i386; UTF-8; en_US (nb) I have jsp page with JS included. The JS code use value of EL. However, the EL is marked as syntax error. See attachement.
Created attachment 52023 [details] screenshot
reproducible, problem of Schlieman parser because of the separated tokens - more info is written in partially fixed issue #119554 - Allow lex and parse javascript string divided by JSP or EL tokens. simplier example to be put into a jsp: <script> if(haha == "${"haha"}") { } </script>
fixed in trunk: IDE: [11/1/07 11:51 AM] Committing "LLSyntaxAnalyser.java" started Checking in LLSyntaxAnalyser.java; /cvs/languages/engine/src/org/netbeans/modules/languages/parser/LLSyntaxAnalyser.java,v <-- LLSyntaxAnalyser.java new revision: 1.53; previous revision: 1.52 done IDE: [11/1/07 11:51 AM] Committing "LLSyntaxAnalyser.java" finished
I'm still able to reproduce the issue in the build 071102. See attachement and also try to open logger/StrutsExceptions, issueDetails.jsp in NetBeans repository.
Created attachment 52403 [details] screenshot
original example works for me. the new one is fixed: IDE: [11/2/07 9:39 PM] Committing "LLSyntaxAnalyser.java" started Checking in LLSyntaxAnalyser.java; /cvs/languages/engine/src/org/netbeans/modules/languages/parser/LLSyntaxAnalyser.java,v <-- LLSyntaxAnalyser.java new revision: 1.58; previous revision: 1.57 done IDE: [11/2/07 9:39 PM] Committing "LLSyntaxAnalyser.java" finished
Verified in build 071105
Using NetBeans IDE 6.5 Beta (Build 200808111757) on Mac 10.4.11, the EL in the Javascript is marked with syntax errors. For example: function setPData() { p_data = new Array(30); <c:set var="pcount" value="0"/> <c:forEach items="${pdata.rows}" var="row"> p_data[${pcount}]=new p(<c:forEach items="${row}" var="col" varStatus="step"> <c:choose> <c:when test="${step.last}">"${fn:escapeXml(col.value)}"</c:when> <c:otherwise>"${fn:escapeXml(col.value)}",</c:otherwise> </c:choose> </c:forEach>); </c:forEach> }
Also cc'ing Marek who may be familiar with this problem.
I think this was fixed as part of the other similar JavaScript embedding fixes recently (-after- beta). It's probably the same issue. In particular, if I load a JSP file which contains your code fragment, and I also add in a taglib definition to define the "c", then I don't get any syntax errors.
Reopening, there is still a problem there.
Tor: what problem did you mean? I cannot reproduce it with the last example now.
Hi Martin, this is tracked by the unit test JsParserTest.test120499 (commented out because it is still not passing). That unit test basically tracks the JavaScript code which gets generated for the corresponding JSP file. The difficulty here is that we're seeing multiple generated-tokens in the parameter list without a comma between them. This confuses the parser. It's great to hear that this doesn't seem to get triggered by the actual JSP file, but it's still a theoretical problem so I've left the bug open. Perhaps it's a lower priority than P2 though.
Fixed in changeset dd1a25285b09. The JavaScript parser now handles extra/missing tokens (provided they're the special embedding tokens) in argument lists, which is what this testcase required. Unit tests reenabled.