The problem is the “,” at the end of the second-to-last line.  It isn’t allowed 
according to the spec at json.org.

It’s not you who made a mistake; it's the json.org spec. JavaScript would allow 
the “,”.  There are so many things
to rant about in that spec document.  I did a bunch of ranting when ECMA-404 
was being debated, but to no
avail.  A fine idea, but many goofy details.

These days, I stick to YAML.  It’s got its own peculiarities, but it's fine.


> On Jun 15, 2026, at 10:35 AM, Ernie Rael <[email protected]> wrote:
> 
> This is more of a "out of curiosity" post.
> 
> I'm putting something together that handles some ui style configurations 
> specified by either *.json and/or *.properties files. There's some junit 
> tests in <project>/src/test/java/.../decorators I put files named styles.json 
> and styles.properties in that same directory.
> 
> The file "styles.json" is marked in error; so my whole project hierarchically 
> is in error. The last line of the file   The file looks like
> 
>   {
>      "default": {
>        "foreground": "#333333",
>   ...
>        "bold": true
>      },
>   }
> 
> The last line, the single '}', has a wavy red underline, with the stop sign 
> '!' in the gutter. Mouse over says
> 
>   Mismatch input '}' expecting String
>   ----
>   (Alt-Enter shows hints)
> 
> Moving the cursor to the last line and doing "Alt-Enter" brings up a one line 
> unadorned box with a black border and white background that says
> 
>   mismatched input '}' expecting String
> 
> I looked in Options>Editor>Hints and found nothing in any Language, and 
> "Search:" of json produced nothing. I looked in a few other Options' tabs; I 
> guess under Miscellaneous>Files I could ignore *.json.
> 
> I got rid of the bad trailing comma and that fixed the problem. But where did 
> this json parser come from and why are there no controls/configuration for 
> it? I guess it's better to have it with no controls/ui-work, than not have it 
> at all.
> 
> -ernie


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to