Skip to content
Suresoft-GLaDOS edited this page May 26, 2023 · 8 revisions

#1

Link : https://github.com/vstakhov/libucl/commit/6236bbe41210214f1b757b680781cebddf6b3d80
Description: Add notice for emitting multi-value keys to msgpack.

At src/ucl_emitter.c

@@ -509,9 +509,9 @@ ucl_emit_msgpack_elt (struct ucl_emitter_context *ctx,
 	case UCL_OBJECT:
 		ucl_emitter_print_key_msgpack (print_key, ctx, obj);
 		ucl_emit_msgpack_start_obj (ctx, obj, print_key);
+		it = NULL;
-		it = ucl_object_iterate_new (obj);
+		while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
-		while ((cur = ucl_object_iterate_safe (it, true)) != NULL) {
 			LL_FOREACH (cur, celt) {
 				ucl_emit_msgpack_elt (ctx, celt, false, true);
 				/* XXX:
@@ -519,21 +519,22 @@ ucl_emit_msgpack_elt (struct ucl_emitter_context *ctx,
 				 * so in case of multi-value keys we are using merely the first
 				 * element ignoring others
 				 */
+				break;
 			}
 		}
-		ucl_object_iterate_free (it);
 		break;
 	case UCL_ARRAY:
 		ucl_emitter_print_key_msgpack (print_key, ctx, obj);
 		ucl_emit_msgpack_start_array (ctx, obj, print_key);
+		it = NULL;
-		it = ucl_object_iterate_new (obj);
+		while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
-		while ((cur = ucl_object_iterate_safe (it, true)) != NULL) {
 			ucl_emit_msgpack_elt (ctx, cur, false, false);
 		}
-		ucl_object_iterate_free (it);
 		break;
 	case UCL_USERDATA:

Tags
#Etc #Multi-line #Modified

#2

Link : https://github.com/vstakhov/libucl/commit/2e2fd34ea696c969148c23fadd088db992c39990
Description: Fix parsing of macro arguments with quotes.

At src/ucl_parser.c

@@ -1831,7 +1831,6 @@ ucl_parse_macro_arguments (struct ucl_parser *parser,
 			if (chunk->remain == 0) {
 				goto restore_chunk;
 			}
+			args_len ++;
 			ucl_chunk_skipc (chunk, p);
 			break;
 		case 99:

Tags
#Logical-error #Single-line #Added

#3

Link : https://github.com/vstakhov/libucl/commit/114a8e4272f3c87c3171d09c927197fa6d554a68
Description: Fix parsing macroses after objects.

At src/ucl_parser.c

@@ -1016,7 +1016,6 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk, bool *next_ke
 		ucl_chunk_skipc (chunk, p);
 		parser->prev_state = parser->state;
 		parser->state = UCL_STATE_MACRO_NAME;
+		*end_of_object = false;
 		return true;
 	}
 	while (p < chunk->end) {

Tags
#Logical-error #Single-line #Added

#4

Link : https://github.com/vstakhov/libucl/commit/fa583ef84e074ee752a2676f1ea1d989f37fdf5a
Description: Fix parsing spaces at the beginning of document.

At src/ucl_parser.c

@@ -1662,10 +1662,6 @@ ucl_state_machine (struct ucl_parser *parser)
 			}
 			else {
 				/* Skip any spaces */
+				while (p < chunk->end && ucl_test_character (*p,
+						UCL_CHARACTER_WHITESPACE_UNSAFE)) {
+					ucl_chunk_skipc (chunk, p);
+				}
 				p = chunk->pos;
 				if (*p == '[') {
 					parser->state = UCL_STATE_VALUE;

Tags
#Omission #Multi-line #Added

#5

Link : https://github.com/vstakhov/libucl/commit/114a8e4272f3c87c3171d09c927197fa6d554a68
Description: Fix parsing macroses after objects.

At src/ucl_parser.c

@@ -1016,7 +1016,6 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk, bool *next_ke
 		ucl_chunk_skipc (chunk, p);
 		parser->prev_state = parser->state;
 		parser->state = UCL_STATE_MACRO_NAME;
+		*end_of_object = false;
 		return true;
 	}
 	while (p < chunk->end) {

Tags
#Logical-error #Single-line #Added

#6

Link : https://github.com/vstakhov/libucl/commit/fa583ef84e074ee752a2676f1ea1d989f37fdf5a
Description: Fix parsing spaces at the beginning of document.

At src/ucl_parser.c

@@ -1662,10 +1662,6 @@ ucl_state_machine (struct ucl_parser *parser)
 			}
 			else {
 				/* Skip any spaces */
+				while (p < chunk->end && ucl_test_character (*p,
+						UCL_CHARACTER_WHITESPACE_UNSAFE)) {
+					ucl_chunk_skipc (chunk, p);
+				}
 				p = chunk->pos;
 				if (*p == '[') {
 					parser->state = UCL_STATE_VALUE;

Tags
#Omission #Multi-line #Added

Clone this wiki locally