Skip to content

Commit d559711

Browse files
committed
refactor and fix:
- consistent function structure: all functions now mirror their JSON counterparts - lydcbor_parse_name() - parses member names with @ and : support - lydcbor_get_node_prefix() - handles module prefixes - lydcbor_get_snode() - finds schema nodes - lydcbor_value_type_hint() - determines value type hints - lydcbor_data_check_opaq() - checks if data should be parsed as opaque - lydcbor_metadata_finish() - links forward-referenced metadata - lydcbor_meta_attr() - parses metadata/attributes - lydcbor_parse_any() - handles anydata/anyxml - lydcbor_parse_instance_inner() - parses inner nodes - lydcbor_parse_instance() - parses single node instances - lydcbor_subtree_r() - main recursive parsing function - using cbor_typeof() consistently to check types instead of multiple cbor_isa_*() calls - better error handling, null handling and array processing and meta data support and qpaque node support - introduced LY_VALUE_CBOR format and added all necessary case statements
1 parent 2a5e854 commit d559711

18 files changed

+1552
-695
lines changed

src/lcbor.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,6 @@ lycbor_token2str(enum cbor_type cbortype)
4545
return "decimals and special values (true, false, nil, ...)";
4646
}
4747

48-
return "";
49-
}
50-
51-
return "object";
52-
case LYJSON_OBJECT_NEXT:
53-
return "object next";
54-
case LYJSON_OBJECT_CLOSED:
55-
return "object closed";
56-
case LYJSON_ARRAY:
57-
return "array";
58-
case LYJSON_ARRAY_NEXT:
59-
return "array next";
60-
case LYJSON_ARRAY_CLOSED:
61-
return "array closed";
62-
case LYJSON_OBJECT_NAME:
63-
return "object name";
64-
case LYJSON_NUMBER:
65-
return "number";
66-
case LYJSON_STRING:
67-
return "string";
68-
case LYJSON_TRUE:
69-
return "true";
70-
case LYJSON_FALSE:
71-
return "false";
72-
case LYJSON_NULL:
73-
return "null";
74-
case LYJSON_END:
75-
return "end of input";
76-
}
77-
7848
return "";
7949
}
8050

0 commit comments

Comments
 (0)