Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AHK v2 a108 code #21

Open
wants to merge 56 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
65caaa1
Fix bug:
cocobelgica Apr 15, 2014
dd8bb64
Fixed:
cocobelgica Apr 23, 2014
6004f64
Minor adjustments. Nothing significant.
cocobelgica Apr 24, 2014
b6d7d59
Modification(s):
cocobelgica Jun 15, 2014
fc657e9
Modification(s):
cocobelgica Jun 18, 2014
55b60c4
Code refactored. Added/fixed inline documentation.
cocobelgica Jul 22, 2014
17be321
Minor fix -> JSON.stringify()
cocobelgica Aug 10, 2014
0025f13
Added Json2.ahk -> first commit.
cocobelgica Aug 14, 2014
9d3563d
Minor fix on formatting
cocobelgica Aug 14, 2014
7586b37
Updated JSON.ahk to mirror v1.1 branch
cocobelgica Aug 17, 2014
d96164f
Added exception handling when dumping non-standard AHK objects
cocobelgica Aug 22, 2014
a013ec1
Commented out JSON.object.Remove() -> Bug: when removing a
cocobelgica Aug 22, 2014
bf80e16
Add README
cocobelgica Sep 6, 2014
e6b1a71
Fixed fcked up formatting
cocobelgica Sep 6, 2014
3e20e57
Fixed link to WTFPL. Minor formatting changes.
cocobelgica Sep 6, 2014
a724372
Code refactored
cocobelgica Jan 7, 2015
71ffa67
.stringify() - Fixed integer keys are not getting quoted.
cocobelgica Jan 7, 2015
a7be08f
.stringify() - 0, 1 and "" are no longer returned as true, false and …
cocobelgica Jan 7, 2015
9f6da79
Updated required AHK version(s)
cocobelgica Jan 7, 2015
58637b6
Fixed: .parse() - 'null' converted to 0 instead of ""
cocobelgica Jan 7, 2015
00f3c74
Added example
cocobelgica Jan 7, 2015
23f6911
Fixed #Include line
cocobelgica Jan 7, 2015
3ddab43
Fixed: [parsing] - 'null' converted to 0 instead of ""
cocobelgica Jan 8, 2015
b66dd5e
Changed: [dumping] - 1, 0 and "" are no longer returned as true, fals…
cocobelgica Jan 8, 2015
3267547
Code refactored
cocobelgica Jan 8, 2015
543ec4b
Minor refactoring
cocobelgica Jan 8, 2015
64745bb
Renamed Json2 to Jxon(function name prefix)
cocobelgica Feb 4, 2015
3435fce
File rename to reflect recent changes.
cocobelgica Feb 4, 2015
d24c6a7
Updated README to reflect changes to Jxon.ahk(previously Json2.ahk)
cocobelgica Feb 4, 2015
cc42d90
Improved string replacement routines, ditched previous workaround.
cocobelgica Feb 11, 2015
b33db32
Jxon_Load(): Changed from two-pass to single-pass method - quoted
cocobelgica Feb 14, 2015
c664a37
Jxon_Load() - Simplified parsing of number(s), true, false and null.
cocobelgica Feb 14, 2015
315d6fe
Jxon_Load() - Fixed a bug when validating next char after comma(,) in…
cocobelgica Feb 14, 2015
46c262b
Jxon_Load() - Improved exception handling - error messages are
cocobelgica Feb 14, 2015
a4824b7
Removed Jxon_Read() and Jxon_Write(). It was a mistake including
cocobelgica Feb 14, 2015
5f8effb
Jxon_Load(): Removed unneeded validation(forgot to remove it).
cocobelgica Feb 14, 2015
f56200a
Jxon_Load(): Simplified dummy 'next' variable(for invalid values).
cocobelgica Feb 15, 2015
834f5f6
Major update based on some commits to Jxon.ahk.
cocobelgica Feb 15, 2015
f6b7ccd
Added some meta info (GH url, email, date of last update).
cocobelgica Feb 15, 2015
d7fe62c
Removed entry on Jxon_Read() and Jxon_Write().
cocobelgica Feb 15, 2015
29be2bf
Updated (relevant)parts to use backported v2.0-a features.
cocobelgica Mar 15, 2015
61c6a8e
Jxon_Dump() - Fixed wrong error being thrown in v2.0-a.
cocobelgica Mar 15, 2015
0f527d6
Updated to use backported v2.0-a features.
cocobelgica Mar 28, 2015
cdac8d4
Method names changed.
cocobelgica Mar 28, 2015
f8b780c
v1.2.00.00
cocobelgica Mar 28, 2015
5795836
Updated README to reflect v1.2.00.00 changes
cocobelgica Mar 28, 2015
cffa384
Updated example to reflect v1.2.00.00 changes.
cocobelgica Mar 28, 2015
af52ad0
v2.0.00.00
cocobelgica Nov 7, 2015
7d6d12d
Update README to reflect v2.0 changes
cocobelgica Nov 7, 2015
ec2d68f
Update example script
cocobelgica Nov 7, 2015
6aaeb3d
v2.1.0 - Small fixes/changes
cocobelgica Jan 27, 2016
43cb649
2.1.1 - Fix issues w/ reviver and replacer functions
cocobelgica Jan 30, 2016
0b5485e
Update version no. and date of last update
cocobelgica Jan 30, 2016
1560aaa
Fix parser to return unquoted floating point numbers as is.
cocobelgica Apr 6, 2016
4520554
Fix [af52ad0] regression where input text is no longer passed as ByRef.
cocobelgica Apr 18, 2016
5d0ca05
Minor refactoring.
cocobelgica Apr 18, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Example_JSON.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#Include %A_LineFile%\..\JSON.ahk

json_str =
(
{
"str": "Hello World",
"num": 12345,
"float": 123.5,
"true": true,
"false": false,
"null": null,
"array": [
"Auto",
"Hot",
"key"
],
"object": {
"A": "Auto",
"H": "Hot",
"K": "key"
}
}
)

parsed := JSON.Load(json_str)

parsed_out := Format("
(Join`r`n
String: {}
Number: {}
Float: {}
true: {}
false: {}
null: {}
array: [{}, {}, {}]
object: {{}A:""{}"", H:""{}"", K:""{}""{}}
)"
, parsed.str, parsed.num, parsed.float, parsed.true, parsed.false, parsed.null
, parsed.array[1], parsed.array[2], parsed.array[3]
, parsed.object.A, parsed.object.H, parsed.object.K)

stringified := JSON.Dump(parsed,, 4)
stringified := StrReplace(stringified, "`n", "`r`n") ; for display purposes only

ListVars
WinWaitActive ahk_class AutoHotkey
ControlSetText Edit1, [PARSED]`r`n%parsed_out%`r`n`r`n[STRINGIFIED]`r`n%stringified%
WinWaitClose
return
Loading