-
Notifications
You must be signed in to change notification settings - Fork 148
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
Add JSON parse and encode function #1272
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
commy2
reviewed
Dec 31, 2019
commy2
reviewed
Dec 31, 2019
commy2
reviewed
Dec 31, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
BaerMitUmlaut
force-pushed
the
json-parser
branch
from
December 31, 2019 17:41
d5d3295
to
0cf4cc1
Compare
This comment has been minimized.
This comment has been minimized.
commy2
reviewed
Jan 1, 2020
Co-Authored-By: commy2 <commy-2@gmx.de>
…into json-parser
commy2
reviewed
Jan 2, 2020
commy2
reviewed
Jan 2, 2020
commy2
reviewed
Jan 2, 2020
Co-Authored-By: commy2 <commy-2@gmx.de>
commy2
suggested changes
Jan 2, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
…into json-parser
Co-Authored-By: commy2 <commy-2@gmx.de>
execVM "\x\cba\addons\hashes\test_parseJSON.sqf" RPT log10:42:58 [CBA] (hashes) Test OK: (CBA_fnc_parseJSON is defined) x\cba\addons\hashes\test_parseJSON.sqf:14
10:42:58 [CBA] (hashes) Test OK: (not (_result)) x\cba\addons\hashes\test_parseJSON.sqf:20
10:42:58 [CBA] (hashes) Test OK: (_result isEqualTo _expected) x\cba\addons\hashes\test_parseJSON.sqf:25
10:42:58 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:29
10:42:58 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:33
10:42:58 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:37
10:42:58 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:41
10:42:58 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:45
10:42:58 [CBA] (hashes) Test OK: (not (_result)) x\cba\addons\hashes\test_parseJSON.sqf:48
10:42:58 [CBA] (hashes) Test OK: (isNull _result) x\cba\addons\hashes\test_parseJSON.sqf:51
10:42:59 [CBA] (hashes) Test OK: (_result) x\cba\addons\hashes\test_parseJSON.sqf:57
10:42:59 [CBA] (hashes) Test OK: (_result isEqualTo _expected) x\cba\addons\hashes\test_parseJSON.sqf:62
10:42:59 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:66
10:42:59 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:70
10:42:59 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:74
10:42:59 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:78
10:42:59 [CBA] (hashes) Test OK: (_result == _expected) x\cba\addons\hashes\test_parseJSON.sqf:82
10:42:59 [CBA] (hashes) Test OK: (not (_result)) x\cba\addons\hashes\test_parseJSON.sqf:85
10:42:59 [CBA] (hashes) Test OK: (isNull _result) x\cba\addons\hashes\test_parseJSON.sqf:88
10:42:59 [CBA] (hashes) Test OK: (CBA_fnc_encodeJSON is defined) x\cba\addons\hashes\test_parseJSON.sqf:95
10:42:59 "null"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "true"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "1.2"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 """Hello, World!"""
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "[]"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "{}"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "[null, true, 1.2, ""Hello, World!""]"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "[{""nested"": [{""nested"": [{""nested"": [{""nested"": [{""nested"": [{""nested"": [{""nested"": []}]}]}]}]}]}]}]"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "null"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "true"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "1.2"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 """Hello, World!"""
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "[]"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "{}"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "[null, true, 1.2, ""Hello, World!""]"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 "[{""nested"": [{""nested"": [{""nested"": [{""nested"": [{""nested"": [{""nested"": [{""nested"": []}]}]}]}]}]}]}]"
10:42:59 [CBA] (hashes) Test OK: (_input == _output) x\cba\addons\hashes\test_parseJSON.sqf:118
10:42:59 [CBA] (hashes) Test OK: (count _properties == 6) x\cba\addons\hashes\test_parseJSON.sqf:126
10:42:59 [CBA] (hashes) Test OK: (typeName _value == _x) x\cba\addons\hashes\test_parseJSON.sqf:129
10:42:59 [CBA] (hashes) Test OK: (typeName _value == _x) x\cba\addons\hashes\test_parseJSON.sqf:129
10:42:59 [CBA] (hashes) Test OK: (typeName _value == _x) x\cba\addons\hashes\test_parseJSON.sqf:129
10:42:59 [CBA] (hashes) Test OK: (typeName _value == _x) x\cba\addons\hashes\test_parseJSON.sqf:129
10:42:59 [CBA] (hashes) Test OK: (typeName _value == _x) x\cba\addons\hashes\test_parseJSON.sqf:129
10:42:59 [CBA] (hashes) Test OK: (typeName _value == _x) x\cba\addons\hashes\test_parseJSON.sqf:129 |
commy2
approved these changes
Jan 3, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very nice.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When merged this pull request will:
Uses a shift-reduce parser, not too complicated. Handles all valid JSON, but will throw script errors with invalid JSON. Escaped unicode characters are not supported because I didn't want to write a hex to dec function.
Closes #1266.