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.

Bug 246638 - Wrong syntax highlighting with nested arrays
Summary: Wrong syntax highlighting with nested arrays
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Twig (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: junichi11
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-22 12:40 UTC by sustmi
Modified: 2017-01-07 08:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Twig highlight problem (3.20 KB, image/png)
2015-02-20 10:44 UTC, antoniocs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sustmi 2014-08-22 12:40:24 UTC
Twig Coding Standards (http://twig.sensiolabs.org/doc/coding_standards.html) states:
"Do not put any spaces before and after the opening and the closing of arrays and hashes"

So this twig code should be valid:
{{ {'foo': {'bar': 'baz'}} }}

But syntax higlighter thinks that }} after 'baz' ends the {{ braces.

It is parsed as:
{{
__{
____'foo': {
______'bar': 'baz'
}} }}

instead of:
{{
__{
____'foo': {
______'bar': 'baz'
____}
__}
}}


Twig Templates Plugin Version = 1.19.3

Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Linux version 3.15.10-200.fc20.x86_64 running on amd64
Java; VM; Vendor = 1.7.0_65
Runtime = OpenJDK 64-Bit Server VM 24.65-b04
Comment 1 antoniocs 2015-02-20 10:44:54 UTC
Created attachment 152111 [details]
Twig highlight problem
Comment 2 antoniocs 2015-02-20 10:46:32 UTC
I am experiencing the same issue.

I am on windows 7 64bit using netbeans 8.0.2.

I am using dark theme, but in the attachment you can see the problem.
The last }} is highlighted white and not brown as the first {{
Comment 3 junichi11 2017-01-05 01:53:48 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/a565fc03acce

Thanks.
Comment 4 Tomas Mysik 2017-01-05 05:56:13 UTC
And again, thanks a lot, Junichi!
Comment 5 Quality Engineering 2017-01-07 08:41:02 UTC
Integrated into 'main-silver', will be available in build *201701070458* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a565fc03acce
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #246638 - Wrong syntax highlighting with nested arrays