File tree Expand file tree Collapse file tree
src/main/java/co/casterlabs/rakurai/json/lex Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,20 @@ public static JsonElement parse(char[] json) {
3333 return parsed ;
3434 }
3535
36+ /**
37+ * Consumes the next token from the queue and parses it into a JsonElement. This
38+ * method is recursive and will call itself when parsing nested structures
39+ * (objects and arrays).
40+ *
41+ * When done, the queue may contain tokens that were not consumed during
42+ * parsing.
43+ *
44+ * For example, when parsing an object, the method will consume tokens until it
45+ * finds the closing brace, but it will not consume any tokens that come after
46+ * the closing brace. The caller is responsible for ensuring that the queue
47+ * contains the correct tokens for parsing and for handling any remaining tokens
48+ * after parsing is complete.
49+ */
3650 private static JsonElement parseTokens (Queue <JsonToken > tokens ) {
3751 JsonToken token = tokens .remove ();
3852 switch (token .type ) {
You can’t perform that action at this time.
0 commit comments