Changeset 325 for binary-improvements/7dtd-server-fixes/src/JSON/Parser.cs
- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/JSON/Parser.cs
r188 r325 1 using System; 2 using System.Text; 3 4 namespace AllocsFixes.JSON 5 { 6 public class Parser 7 { 8 9 public static JSONNode Parse (string json) 10 { 1 namespace AllocsFixes.JSON { 2 public class Parser { 3 public static JSONNode Parse (string json) { 11 4 int offset = 0; 12 5 return ParseInternal (json, ref offset); 13 6 } 14 7 15 public static JSONNode ParseInternal (string json, ref int offset) 16 { 8 public static JSONNode ParseInternal (string json, ref int offset) { 17 9 SkipWhitespace (json, ref offset); 10 18 11 //Log.Out ("ParseInternal (" + offset + "): Decide on: '" + json [offset] + "'"); 19 12 switch (json [offset]) { … … 34 27 } 35 28 36 public static void SkipWhitespace (string json, ref int offset) 37 { 29 public static void SkipWhitespace (string json, ref int offset) { 38 30 //Log.Out ("SkipWhitespace (" + offset + "): '" + json [offset] + "'"); 39 31 while (offset < json.Length) { … … 49 41 } 50 42 } 43 51 44 throw new MalformedJSONException ("End of JSON reached before parsing finished"); 52 45 } 53 54 55 46 } 56 47 } 57
Note:
See TracChangeset
for help on using the changeset viewer.