AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JSON read/write parser
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Lexikos



Joined: 17 Oct 2006
Posts: 4472
Location: Qld, Australia

PostPosted: Sun Dec 21, 2008 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
hughman



Joined: 11 Feb 2007
Posts: 92

PostPosted: Thu May 07, 2009 8:35 am    Post subject: Reply with quote

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:
Code:

js = {"a.b.c":123}


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
View user's profile Send private message
joelpt



Joined: 24 Jun 2009
Posts: 11

PostPosted: Fri Sep 18, 2009 1:44 am    Post subject: Reply with quote

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
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Fri Sep 18, 2009 7:01 pm    Post subject: Reply with quote

Try from Titan's Scripts.

HTH
Back to top
joelpt



Joined: 24 Jun 2009
Posts: 11

PostPosted: Fri Sep 18, 2009 7:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group