| View previous topic :: View next topic |
| Author |
Message |
Lexikos
Joined: 17 Oct 2006 Posts: 7288 Location: Australia
|
Posted: Sun Dec 21, 2008 2:11 pm Post subject: |
|
|
| Thanks. The current behaviour is adequate for my use - always 'name':number. """name"":" expression repeated several times didn't appeal to me. |
|
| Back to top |
|
 |
hughman
Joined: 11 Feb 2007 Posts: 166
|
Posted: Thu May 07, 2009 7:35 am Post subject: |
|
|
Thanks for the wonderful work, but I have some questions:
1.
what's meaning of (?-1)? reference in the opposite direction?
And what about q2 == "*" ?
And it doesn't need to escaped { } [ + in [^{}] , [^[\]] , ([+\-]?)?
2.
if the object string includes a ".", how to refer to it? For instance:
3.
| Quote: | | z += p + StrLen(x2) - 2 |
should be
| Quote: | | z += p + StrLen(x2) + 2 |
4.
| Quote: | If (!p := RegExMatch(j, "(?<!\\)(""|')([^\1]+?)(?<!\\)(?-1)\s*:\s*((\{(?:[^\{\}]++|(?-1))*\})|(\[(?:[^\[\]]++|(?-1))*\])|"
. "(?<!\\)(""|')[^\7]*?(?<!\\)(?-1)|[+\-]?\d+(?:\.\d*)?|true|false|null?)\s*(?:,|$|\})", x, p)) |
The red part should be [^\7] or [^\6]?
5. There're a lot of problems about array such as that it can get but can't set the value of array correctly.
Do you have a plan to update this function? If the parsing can be improved, then AHK will own a powerful and flexible function about associative array or table like LUA's. |
|
| Back to top |
|
 |
joelpt
Joined: 24 Jun 2009 Posts: 14
|
Posted: Fri Sep 18, 2009 12:44 am Post subject: |
|
|
I tried both the links in the first post of this thread to downlod json.ahk but neither link works. The more recent one comes up with a blank page.
Can anyone help? |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Fri Sep 18, 2009 6:01 pm Post subject: |
|
|
Try from Titan's Scripts.
HTH |
|
| Back to top |
|
 |
joelpt
Joined: 24 Jun 2009 Posts: 14
|
Posted: Fri Sep 18, 2009 6:14 pm Post subject: |
|
|
The bare link to json.ahk on that page also yielded an empty file, but opening it from the HTTP SVN link worked.
Thanks!! |
|
| Back to top |
|
 |
camerb
Joined: 19 Mar 2009 Posts: 547 Location: Texas, USA
|
Posted: Thu Jun 24, 2010 10:29 pm Post subject: |
|
|
Hott! _________________ Aren't you glad that I didn't put an annoying gif here? |
|
| Back to top |
|
 |
hughman
Joined: 11 Feb 2007 Posts: 166
|
Posted: Fri Jun 25, 2010 8:16 am Post subject: |
|
|
If someone rewrites it with AHK_L, converts json to object, it must be more powerful, flexible and efficient. I wait it
btw: AutoIt3 owns a udf library with full funtions |
|
| Back to top |
|
 |
EGM
Joined: 25 Jul 2010 Posts: 13
|
Posted: Sun Aug 29, 2010 4:00 pm Post subject: |
|
|
| Curiously, does the json parser handle comments? |
|
| Back to top |
|
 |
polyethene
Joined: 11 Aug 2004 Posts: 5248 Location: UK
|
Posted: Sun Aug 29, 2010 4:05 pm Post subject: |
|
|
The JSON spec doesn't cover comments. If you mean JavaScript comments in JSON code then you can easily remove them with a simple regex. _________________ GitHub • Scripts • IronAHK • Contact by email not private message. |
|
| Back to top |
|
 |
EGM
Joined: 25 Jul 2010 Posts: 13
|
Posted: Sun Sep 05, 2010 11:01 am Post subject: |
|
|
Thank you for the simple explanation, and for the JSON function, I've been having a lot of fun with it.  |
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Wed Dec 01, 2010 7:45 pm Post subject: |
|
|
I'll paste some new AHK code for JSON parsing, importing and exporting,
and easy accessing as soon as I'll be able to post it complete.  |
|
| Back to top |
|
 |
lordkrandel
Joined: 12 Dec 2010 Posts: 30
|
|
| Back to top |
|
 |
|