Author Topic: Problem with parentheses matching  (Read 151 times)

redcar

  • Community Member
  • Posts: 25
  • Hero Points: 0
Problem with parentheses matching
« on: March 31, 2021, 08:20:15 am »
Paste the following text into an empty JSON document and see if the matching of the curly and square brackets works as expected.  It doesn't for me.


{
    \"ID\": 256,
    \"Things\": [
        {
            \"Thing\": 1,
            \"Group\": {
                \"What\": \"AllOf\",
                \"Who\":
                [\"АБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗ\",
                        \"АБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗ\",
                        \"АБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗ\",
                        \"АБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗАБВГДЕЖЗ\"]
            }
        }]
}]

Build Date: December 16, 2020   (State file: February 9, 2021)
Emulation: CUA

OS: Linux
OS Version: S
Kernel Level: 3.10.0-1160.21.1.el7.x86_64
Build Version: #1 SMP Tue Mar 16 18:28:22 UTC 2021
Processor Architecture: x86_64



Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5735
  • Hero Points: 458
Re: Problem with parentheses matching
« Reply #1 on: March 31, 2021, 01:43:02 pm »
Notice that the color coding for this JSON document does not look right. That is why parenthesis matching doesn't work.

As far as I can tell, code like the following is NOT a valid string.
Code: [Select]
\"whatever\"

You can change SlickEdit's color coding. Go to Options>Languages>Web Authoring Languages>JSON>Color coding>Tokens Tab.

Remove the "Escape char" for the double quoted string.

Once the color coding of strings works for odd JSON like this, the parenthesis matching will work.
« Last Edit: April 01, 2021, 02:37:12 am by Clark »