// Parse an object.
static inline void Json_Parse_Object(struct qjson_state_s *json)
{
- Parse_IncDepth(json->state);
+ Parse_Indent(json->state);
/*
* Json objects are basically a data map; key-value pairs.
if(Parse_CurrentToken(json->state) != '}')
Parse_Error(json->state, PARSE_ERR_INVAL, ", or }");
- Parse_DecDepth(json->state);
+ Parse_Dedent(json->state);
}
// Parse an array.
static inline void Json_Parse_Array(struct qjson_state_s *json)
{
- Parse_IncDepth(json->state);
+ Parse_Indent(json->state);
/*
* Json arrays are basically lists. They can contain
if(Parse_CurrentToken(json->state) != ']')
Parse_Error(json->state, PARSE_ERR_INVAL, ", or ]");
- Parse_DecDepth(json->state);
+ Parse_Dedent(json->state);
}
// Main function for the parser.
qparser_state_t *Parse_New(const unsigned char *in);
qparser_state_t *Parse_LoadFile(const char *file);
-static inline void Parse_IncDepth(struct qparser_state_s *state)
+static inline void Parse_Indent(struct qparser_state_s *state)
{
if(state->depth >= PARSER_MAX_DEPTH)
Parse_Error(state, PARSE_ERR_DEPTH, NULL);
state->depth++;
}
-static inline void Parse_DecDepth(struct qparser_state_s *state)
+static inline void Parse_Dedent(struct qparser_state_s *state)
{
state->depth--;
}
\ No newline at end of file