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 218099 - Ini syntax highlighting not correctly interpreting escaped ;
Summary: Ini syntax highlighting not correctly interpreting escaped ;
Status: RESOLVED INVALID
Alias: None
Product: php
Classification: Unclassified
Component: Ini files (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-11 07:44 UTC by mienamoo
Modified: 2012-09-12 14:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Ini screenshot (6.42 KB, image/png)
2012-09-12 14:10 UTC, mienamoo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mienamoo 2012-09-11 07:44:56 UTC
NetBeans build 201209100001
JDK 7u5 64-bit

I just noticed the brand new syntax highlighting for ini files. Very cool indeed! However, it does not interpret \; (escaped ;) correctly. The part from ; is shown in grey as if it was a comment despite the fact that it is in fact escaped.
Comment 1 Milutin Kristofic 2012-09-12 13:55:43 UTC
According https://blogs.oracle.com/netbeansphp/entry/ini_files_support_available ini files are supported by php.
Comment 2 Tomas Mysik 2012-09-12 13:57:56 UTC
(In reply to comment #0)
> However, it does not interpret \; (escaped ;) correctly.

Any documentation available for it?

Thanks.
Comment 3 mienamoo 2012-09-12 14:06:26 UTC
(In reply to comment #1)
> According
> https://blogs.oracle.com/netbeansphp/entry/ini_files_support_available ini
> files are supported by php.

That post was quite a long time ago (2010). I noticed this in my platform application project only this week. And I didn't have any PHP modules installed when it first appeared.

Also, it seems that the behaviour is different. For example, the disallowed bit in that screenshot doesn't appear red when I look at it in my IDE today.
Comment 4 mienamoo 2012-09-12 14:10:54 UTC
Created attachment 124245 [details]
Ini screenshot

I am attaching a screenshot of the highlighting as it is now, showing one of the same items in the screenshot at https://blogs.oracle.com/netbeansphp/entry/ini_files_support_available.
Comment 5 Tomas Mysik 2012-09-12 14:25:59 UTC
The blog post is not correct, sorry about that. We follow parsing from PHP, try to call parse_ini_file() on this file:

k1 = a;b
k2 = a\;b
k3 = 'a;b'
k4 = "a;b"
k5 = a;;b

The result (for INI_SCANNER_NORMAL [1]) is:

Array
(
    [k1] => a
    [k2] => a\
    [k3] => a;b
    [k4] => a;b
    [k5] => a
)

It means that there is (likely?) no way to escape semicolon.

Thanks for reporting.
[1] Please notice that the result for INI_SCANNER_RAW is slightly different.
Comment 6 mienamoo 2012-09-12 14:34:13 UTC
Ah I see. I am using ini4j to parse the ini file, which is in a NetBeans Platform application module. And it does treat \; as an escape sequence, hence the confusion. :)
Comment 7 Tomas Mysik 2012-09-12 14:48:34 UTC
The problem is that AFAIK there is no official/standard format specification for INI files.
Comment 8 mienamoo 2012-09-12 14:53:04 UTC
(In reply to comment #7)
> The problem is that AFAIK there is no official/standard format specification
> for INI files.

Indeed. It seems that there are lots of differences between the implementations of the general idea of an INI file. :)