Jump to content


Photo

AutoHotkey_L v1.0.97.02


  • Please log in to reply
10 replies to this topic

#1 Lexikos

Lexikos
  • Administrators
  • 8844 posts

Posted 28 March 2011 - 02:36 AM

v1.0.97.00 (March 28)

Added {key: value} as syntax sugar for Object("key", value).
Added [x, y, z] as syntax sugar for Array(x, y, z), which is a new function equivalent to Object(1, x, 2, y, 3, z).
Added slight optimization: resolve any reference to True, False, A_PtrSize or A_IsUnicode in expressions at load-time.
Fixed hotkey parser to treat x & ^y as an error instead of ignoring ^.

v1.0.97.01 (April 2)

Fixed the 64-bit build to not truncate HWNDs or SendMessage/PostMessage params to 32 bits.
Fixed */:: being treated as an invalid hotkey (broken since L54).
Fixed the icons.

v1.0.97.02 (April 14)

Fixed misinterpretation of comma as an arg delimiter when enclosed in {} in an expression.
Fixed For-loop to set A_Index only after the Expression arg is evaluated, so that the outer loop's value can be used.
Fixed default script location to be based on the directory containing the EXE (as documented), not the working directory.
Improved load-time validation to detect invalid attempts to jump out of a function with Goto.

Downloads (etc.)Background information about the new syntax features can be found in the following two threads:
[*:109xg9c3]AutoHotkey_L beta with JSON support
[*:109xg9c3]Wish List: JSON -- obj := {key: value}, arr := [x, y, z]

#2 flak

flak
  • Members
  • 283 posts

Posted 28 March 2011 - 05:03 AM

Is there any easy way to convert JSON string stored in variable to object without parsing it all over again?
Something roughly like Object("{ data: { translations: [ { translatedText: ""Test"" } ] }}")

#3 Lexikos

Lexikos
  • Administrators
  • 8844 posts

Posted 28 March 2011 - 05:08 AM

That would be entirely impossible. Maybe you meant "without the script parsing it", in which case the answer is "no". These new features are simple extensions of expression syntax. Dynamic evaluation of expressions is not supported.

#4 a4u

a4u
  • Guests

Posted 28 March 2011 - 09:38 PM

Thank You Sir - I've been highly anticipating the JSON support since the release of the For-loop :) . Everything seems to be working good.

#5 awesomeo

awesomeo
  • Members
  • 28 posts

Posted 29 March 2011 - 08:34 AM

Wow! Nice one - couldn't have come at a more appropriate time (for me anyway).

Works perfectly for me; combined with the ‘WinHttp.WinHttpRequest.5.1’ COM object makes for easy JSON-RPC conversations.

Thank you!!!!!!!!!

#6 Lexikos

Lexikos
  • Administrators
  • 8844 posts

Posted 02 April 2011 - 01:23 AM

v1.0.97.01

Fixed the 64-bit build to not truncate HWNDs or SendMessage/PostMessage params to 32 bits.
Fixed */:: being treated as an invalid hotkey (broken since L54).
Fixed the icons.

#7 Learning one

Learning one
  • Members
  • 1294 posts

Posted 02 April 2011 - 07:05 AM

Thank you for continued support. As always, you are doing a great job! 8)

#8 RaptorX

RaptorX
  • Members
  • 715 posts

Posted 07 April 2011 - 07:06 PM

I am not complaining or anything but is there any reason why you decided to not allow newlines before the braces when creating objects with the JSON format?

example:


; works
var1 := {  key1 : "this will work fine"
             ,  key2 : "because is the correct syntax" }


; doesnt work
var2 := {
	       key1 : "this wont work"
	      ,key2 : "it will cause an error"
	     }


#9 fragman

fragman
  • Members
  • 1591 posts

Posted 07 April 2011 - 08:56 PM

I think the comma might make it act like auto concatenation for expressions in your first case.

#10 Lexikos

Lexikos
  • Administrators
  • 8844 posts

Posted 07 April 2011 - 09:37 PM

Look for "continuation sections" in the help file index. This applies to all lines, including expressions and directives. Continuation sections and continuation lines take effect very early, before the virtual "line" (which may consist of multiple physical lines) is parsed. Your first example uses a continuation line, whereas your second does not.

Rather than "newlines before the braces" I think you meant newlines between the braces. It's simply not feasible with the current interpreter.

#11 Lexikos

Lexikos
  • Administrators
  • 8844 posts

Posted 14 April 2011 - 01:02 PM

v1.0.97.02

Fixed misinterpretation of comma as an arg delimiter when enclosed in {} in an expression.
Fixed For-loop to set A_Index only after the Expression arg is evaluated, so that the outer loop's value can be used.
Fixed default script location to be based on the directory containing the EXE (as documented), not the working directory.
Improved load-time validation to detect invalid attempts to jump out of a function with Goto.