Changeset 391 for binary-improvements2/7dtd-server-fixes/src/JSON/Parser.cs
- Timestamp:
- Aug 7, 2022, 3:02:24 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/7dtd-server-fixes/src/JSON/Parser.cs
r351 r391 1 1 namespace AllocsFixes.JSON { 2 public class Parser {3 public static J SONNode Parse (string _json) {2 public static class Parser { 3 public static JsonNode Parse (string _json) { 4 4 int offset = 0; 5 5 return ParseInternal (_json, ref offset); 6 6 } 7 7 8 public static J SONNode ParseInternal (string _json, ref int _offset) {8 public static JsonNode ParseInternal (string _json, ref int _offset) { 9 9 SkipWhitespace (_json, ref _offset); 10 10 … … 12 12 switch (_json [_offset]) { 13 13 case '[': 14 return J SONArray.Parse (_json, ref _offset);14 return JsonArray.Parse (_json, ref _offset); 15 15 case '{': 16 return J SONObject.Parse (_json, ref _offset);16 return JsonObject.Parse (_json, ref _offset); 17 17 case '"': 18 return J SONString.Parse (_json, ref _offset);18 return JsonString.Parse (_json, ref _offset); 19 19 case 't': 20 20 case 'f': 21 return J SONBoolean.Parse (_json, ref _offset);21 return JsonBoolean.Parse (_json, ref _offset); 22 22 case 'n': 23 return J SONNull.Parse (_json, ref _offset);23 return JsonNull.Parse (_json, ref _offset); 24 24 default: 25 return J SONNumber.Parse (_json, ref _offset);25 return JsonNumber.Parse (_json, ref _offset); 26 26 } 27 27 } … … 42 42 } 43 43 44 throw new MalformedJ SONException ("End of JSON reached before parsing finished");44 throw new MalformedJsonException ("End of JSON reached before parsing finished"); 45 45 } 46 46 }
Note:
See TracChangeset
for help on using the changeset viewer.