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.
[#200707310000, jdk1.5.0] to reproduce: ------------- 1) type in a .jsp: <% String color = "rgb(138, 161, 182)"; %> <style type="text/css"> body { background-color: <%= color %>; } </style> <% String string = "To JavaScript"; %> <script language="javascript"> var jsString = '<%= string %>'; </script> ERROR: both Scripting Expressions <%= ... %> are marked as Syntax Errors and breaks Syntax Coloring and CC features.
reproducible, should be fixed.
One problem is that the embedding is created just for the first pieces of style code just to the expression language piece. To reproduce, try: <style type="text/css"> body { <%="color"%>: red; background-color: yellow; } </style> ...the embedding is created just for the "body {" part, the rest is plain html.
for now, fixed the problem above. The embedding for css is now properly created for all pieces divided by some other higher level tokens inside. <style> body { text-align: left <%="color"%>: red; background-color: yellow; } </style> however this doesn't work for javascript since the embedding is done statically (implemented in lexer) and because of issue #87014 the javascript token doesn't continue after the higher level language token. Try following example. <script> <%="var x='hello';"%> function greet() { alert(x); } </script> r javascript since the embedding is done statically (implemented in lexer) and because of issue #87014 the javascript token doesn't continue after the higher level language token. Try following example. <script> <%="var x='hello';"%> function greet() { alert(x); } </script> r javascript since the embedding is done statically (implemented in lexer) and because of issue #87014 the javascript token doesn't continue after the higher level language token. Try following example. <script> <%="var x='hello';"%> function greet() { alert(x); } </script> Checking in EmbeddingUpdater.java; /cvs/html/editor/src/org/netbeans/modules/html/editor/coloring/EmbeddingUpdater.java,v <-- EmbeddingUpdater.java new revision: 1.9; previous revision: 1.8 done
(I am sorry for the previous broken comment) To get rid of the error marks completely we need to improve Schlieman engine in the way that it can substitute some of the grammar terminals by a "gap". From the embedded language point of view the gap is the empty place in the location of the higher level token. Example: <style> h1{ color: <%="red"%>; } </style> the "gap" in the location of <%="red"%> needs to be somehow reflected in the css language grammar. I am not sure now, but I suspect it didn't work even if we had the "gap support" due to issue #87014 which causes that the two parts of the css tokens are not properly "joined" in terms of moving lexer state from the location before <%="red"%> to the location above the token.
*** Issue 103589 has been marked as a duplicate of this issue. ***
I filled a separated issue #112998 for the "gap" support.
*** Issue 113058 has been marked as a duplicate of this issue. ***
*** Issue 116059 has been marked as a duplicate of this issue. ***
*** Issue 116410 has been marked as a duplicate of this issue. ***
*** Issue 117927 has been marked as a duplicate of this issue. ***
fixed, except the case where css or javascript tokens are divided by the higher level embedding. The ideal fix needs to be done after issue #117450 (Provide unified LexerInput across multiple joined embedded sections) is fixed. However this won't happen in 6.0 so no way how to fix this now. Since most of the reports complains about the errors being shown for JSP or EL tokens in javascript string, we agreed with Hanz he will try to workaround this particular usecase in 6.0 - I have filed separated issue #119554 (Allow lex and parse javascript string divided by JSP or EL tokens) for the problem. Checking in JSP.java; /cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JSP.java,v <-- JSP.java new revision: 1.14; previous revision: 1.13 done Checking in JavaScript.nbs; /cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/JavaScript.nbs,v <-- JavaScript.nbs new revision: 1.50; previous revision: 1.49 done Checking in HTML.nbs; /cvs/html/editor/src/org/netbeans/modules/html/editor/resources/HTML.nbs,v <-- HTML.nbs new revision: 1.13; previous revision: 1.12 done Checking in engine/src/org/netbeans/modules/languages/parser/LLSyntaxAnalyser.java; /cvs/languages/engine/src/org/netbeans/modules/languages/parser/LLSyntaxAnalyser.java,v <-- LLSyntaxAnalyser.java new revision: 1.49; previous revision: 1.48 done Checking in css/src/org/netbeans/modules/languages/css/CSS_inlined.nbs; /cvs/languages/css/src/org/netbeans/modules/languages/css/CSS_inlined.nbs,v <-- CSS_inlined.nbs new revision: 1.4; previous revision: 1.3 done Checking in css/src/org/netbeans/modules/languages/css/CSS.nbs; /cvs/languages/css/src/org/netbeans/modules/languages/css/CSS.nbs,v <-- CSS.nbs new revision: 1.24; previous revision: 1.23 done
verified Product Version: NetBeans IDE Dev (Build 200811011401) Java: 1.6.0_10-rc2; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.24-21-generic running on i386; UTF-8; en_US (nb)