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.
Sample: <td style="padding-left:{=($indent[$record->level] * 8) + 5}px">{$record->function}</td> The ":" is marked as error but it should not be, right? Thanks. Product Version: NetBeans IDE 8.0 (Build 201403101706) Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 2 Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 System: Linux version 3.13.0-34-generic running on amd64; UTF-8; cs_CZ (nb)
I encountered this bug as well in this code sample: <td style="color: rgb({=100-$percentDone}%, {=round($percentDone*0.8)}%, 0%)">{$percentDone}%</td> I believe the mistake is caused by {=expression} macro not being supported. I believe the code causing this is located in the file php.latte/tools/LatteTopColoringLexer.flex, line 351: {SYNTAX_LATTE_START}[a-zA-Z0-9_/\!\?\$] { "!" is the old macro, latte uses "=" in the last version. The latest Nette documentation says: "Variable and expression printing {expression} (...) Without escaping by using the |noescape modifier (an exclamation mark was used in older Nette versions): (...) Alternatively you can use notations with equals sign {=expression}." (http://doc.nette.org/en/2.3/default-macros) In latte github, the {=expression} macro is clearly defined in this file: https://github.com/nette/latte/blob/master/src/Latte/Macros/CoreMacros.php I would like to try contributing to NetBeans, could I try to correct this by fixing the code, testing and creating the diff? Thanks! Product Version: NetBeans IDE 8.0.2 (Build 201411181905) Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1 Java: 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Windows 7 version 6.1 running on amd64; Cp1250; cs_CZ (nb)
Created attachment 153260 [details] Bugfix 246488, added support for {=expression} macro Contains fixed LatteTopColoringLexer.flex and LatteTopColoringLexer.java generated from it. The LatteTopColoringLexer.java has some changes added after being generated by jFlex. So in order to not accidentaly exclude some, I first generated the class from the current LatteTopColoringLexer.flex, diffed against current LatteTopColoringLexer.java (to have the extra changes) and based on that created fixed version of LatteTopColoringLexer.java generated from fixed LatteTopColoringLexer.flex.
I created the patch against the latest revision (368561a5a89c+), and tested it on this revision. The macro {=expression} is now correctly recognized. I kept the support for old {!expression} macro, since older latte versions still use it. It contains fixed LatteTopColoringLexer.flex and LatteTopColoringLexer.java generated from it. The LatteTopColoringLexer.java has some changes added after being generated by jFlex. So in order to not accidentaly exclude some, I first generated the class from the current LatteTopColoringLexer.flex, diffed against current LatteTopColoringLexer.java (to have the extra changes) and based on that created fixed version of LatteTopColoringLexer.java generated from fixed LatteTopColoringLexer.flex.
@petrsmrcek: Could you please add a unit test for it? See [1], add a method to [2] to generate a proper golden file for the test. Thanks a lot! [1] Unit Test Data/testfiles/lexer/top/syntax-equal.latte [2] LatteTopLexerTest.java
Created attachment 153292 [details] updated patch with unit test The test latte added and .pass file generated, I hope this is the correct way. I have put there all 3 default ways to avoid escaping in latte. By the way, I have to say, that test generation is quite nice and easy!
Your patch has been integrated, thanks a lot for it! http://hg.netbeans.org/web-main/rev/4b2202da9239
Integrated into 'main-silver', will be available in build *201504230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4b2202da9239 User: Tomas Mysik <tmysik@netbeans.org> Log: #246488 - Incorrect syntax error reported Patch contributed by petrsmrcek@netbeans.org.