Simplify some current_block matches

This commit is contained in:
David Tolnay 2022-07-30 02:42:02 -07:00
parent 91400c631f
commit 5548f3544e
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
4 changed files with 839 additions and 987 deletions

View file

@ -679,9 +679,7 @@ pub unsafe fn yaml_document_start_event_initialize(
} else { } else {
current_block = 16203760046146113240; current_block = 16203760046146113240;
} }
match current_block { if current_block != 14964981520188694172 {
14964981520188694172 => {}
_ => {
memset( memset(
event as *mut libc::c_void, event as *mut libc::c_void,
0, 0,
@ -699,7 +697,6 @@ pub unsafe fn yaml_document_start_event_initialize(
(*event).data.document_start.implicit = implicit; (*event).data.document_start.implicit = implicit;
return OK; return OK;
} }
}
yaml_free(version_directive_copy as *mut libc::c_void); yaml_free(version_directive_copy as *mut libc::c_void);
while !STACK_EMPTY!(tag_directives_copy) { while !STACK_EMPTY!(tag_directives_copy) {
let value = POP!(tag_directives_copy); let value = POP!(tag_directives_copy);
@ -812,8 +809,7 @@ pub unsafe fn yaml_scalar_event_initialize(
} else { } else {
current_block = 8515828400728868193; current_block = 8515828400728868193;
} }
match current_block { if current_block == 8515828400728868193 {
8515828400728868193 => {
if !tag.is_null() { if !tag.is_null() {
if yaml_check_utf8(tag, strlen(tag as *mut libc::c_char)).fail { if yaml_check_utf8(tag, strlen(tag as *mut libc::c_char)).fail {
current_block = 16285396129609901221; current_block = 16285396129609901221;
@ -828,9 +824,7 @@ pub unsafe fn yaml_scalar_event_initialize(
} else { } else {
current_block = 12800627514080957624; current_block = 12800627514080957624;
} }
match current_block { if current_block != 16285396129609901221 {
16285396129609901221 => {}
_ => {
if length < 0 { if length < 0 {
length = strlen(value as *mut libc::c_char) as libc::c_int; length = strlen(value as *mut libc::c_char) as libc::c_int;
} }
@ -864,9 +858,6 @@ pub unsafe fn yaml_scalar_event_initialize(
} }
} }
} }
}
_ => {}
}
yaml_free(anchor_copy as *mut libc::c_void); yaml_free(anchor_copy as *mut libc::c_void);
yaml_free(tag_copy as *mut libc::c_void); yaml_free(tag_copy as *mut libc::c_void);
yaml_free(value_copy as *mut libc::c_void); yaml_free(value_copy as *mut libc::c_void);
@ -924,9 +915,7 @@ pub unsafe fn yaml_sequence_start_event_initialize(
} else { } else {
current_block = 7651349459974463963; current_block = 7651349459974463963;
} }
match current_block { if current_block != 8817775685815971442 {
8817775685815971442 => {}
_ => {
memset( memset(
event as *mut libc::c_void, event as *mut libc::c_void,
0, 0,
@ -944,7 +933,6 @@ pub unsafe fn yaml_sequence_start_event_initialize(
return OK; return OK;
} }
} }
}
_ => {} _ => {}
} }
yaml_free(anchor_copy as *mut libc::c_void); yaml_free(anchor_copy as *mut libc::c_void);
@ -1006,8 +994,7 @@ pub unsafe fn yaml_mapping_start_event_initialize(
} else { } else {
current_block = 11006700562992250127; current_block = 11006700562992250127;
} }
match current_block { if current_block == 11006700562992250127 {
11006700562992250127 => {
if !tag.is_null() { if !tag.is_null() {
if yaml_check_utf8(tag, strlen(tag as *mut libc::c_char)).fail { if yaml_check_utf8(tag, strlen(tag as *mut libc::c_char)).fail {
current_block = 14748279734549812740; current_block = 14748279734549812740;
@ -1022,9 +1009,7 @@ pub unsafe fn yaml_mapping_start_event_initialize(
} else { } else {
current_block = 7651349459974463963; current_block = 7651349459974463963;
} }
match current_block { if current_block != 14748279734549812740 {
14748279734549812740 => {}
_ => {
memset( memset(
event as *mut libc::c_void, event as *mut libc::c_void,
0, 0,
@ -1042,9 +1027,6 @@ pub unsafe fn yaml_mapping_start_event_initialize(
return OK; return OK;
} }
} }
}
_ => {}
}
yaml_free(anchor_copy as *mut libc::c_void); yaml_free(anchor_copy as *mut libc::c_void);
yaml_free(tag_copy as *mut libc::c_void); yaml_free(tag_copy as *mut libc::c_void);
FAIL FAIL
@ -1205,9 +1187,7 @@ pub unsafe fn yaml_document_initialize(
} else { } else {
current_block = 14818589718467733107; current_block = 14818589718467733107;
} }
match current_block { if current_block != 8142820162064489797 {
8142820162064489797 => {}
_ => {
memset( memset(
document as *mut libc::c_void, document as *mut libc::c_void,
0, 0,
@ -1231,7 +1211,6 @@ pub unsafe fn yaml_document_initialize(
(*document).end_mark = mark; (*document).end_mark = mark;
return OK; return OK;
} }
}
STACK_DEL!(nodes); STACK_DEL!(nodes);
yaml_free(version_directive_copy as *mut libc::c_void); yaml_free(version_directive_copy as *mut libc::c_void);
while !STACK_EMPTY!(tag_directives_copy) { while !STACK_EMPTY!(tag_directives_copy) {

View file

@ -59,9 +59,7 @@ pub unsafe fn yaml_parser_load(
} else { } else {
current_block = 7815301370352969686; current_block = 7815301370352969686;
} }
match current_block { if current_block != 6234624449317607669 {
6234624449317607669 => {}
_ => {
if (*parser).stream_end_produced { if (*parser).stream_end_produced {
return OK; return OK;
} }
@ -80,7 +78,6 @@ pub unsafe fn yaml_parser_load(
} }
} }
} }
}
yaml_parser_delete_aliases(parser); yaml_parser_delete_aliases(parser);
yaml_document_delete(document); yaml_document_delete(document);
let fresh8 = addr_of_mut!((*parser).document); let fresh8 = addr_of_mut!((*parser).document);
@ -353,9 +350,7 @@ unsafe fn yaml_parser_load_scalar(
} else { } else {
current_block = 11006700562992250127; current_block = 11006700562992250127;
} }
match current_block { if current_block != 10579931339944277179 {
10579931339944277179 => {}
_ => {
memset( memset(
node as *mut libc::c_void, node as *mut libc::c_void,
0, 0,
@ -380,7 +375,6 @@ unsafe fn yaml_parser_load_scalar(
return yaml_parser_load_node_add(parser, ctx, index); return yaml_parser_load_node_add(parser, ctx, index);
} }
} }
}
yaml_free(tag as *mut libc::c_void); yaml_free(tag as *mut libc::c_void);
yaml_free((*event).data.scalar.anchor as *mut libc::c_void); yaml_free((*event).data.scalar.anchor as *mut libc::c_void);
yaml_free((*event).data.scalar.value as *mut libc::c_void); yaml_free((*event).data.scalar.value as *mut libc::c_void);
@ -426,9 +420,7 @@ unsafe fn yaml_parser_load_sequence(
} else { } else {
current_block = 6937071982253665452; current_block = 6937071982253665452;
} }
match current_block { if current_block != 13474536459355229096 {
13474536459355229096 => {}
_ => {
STACK_INIT!(items, yaml_node_item_t); STACK_INIT!(items, yaml_node_item_t);
memset( memset(
node as *mut libc::c_void, node as *mut libc::c_void,
@ -449,8 +441,7 @@ unsafe fn yaml_parser_load_sequence(
.top .top
.c_offset_from((*(*parser).document).nodes.start) .c_offset_from((*(*parser).document).nodes.start)
as libc::c_int; as libc::c_int;
if yaml_parser_register_anchor(parser, index, (*event).data.sequence_start.anchor) if yaml_parser_register_anchor(parser, index, (*event).data.sequence_start.anchor).fail
.fail
{ {
return FAIL; return FAIL;
} }
@ -464,7 +455,6 @@ unsafe fn yaml_parser_load_sequence(
return OK; return OK;
} }
} }
}
yaml_free(tag as *mut libc::c_void); yaml_free(tag as *mut libc::c_void);
yaml_free((*event).data.sequence_start.anchor as *mut libc::c_void); yaml_free((*event).data.sequence_start.anchor as *mut libc::c_void);
FAIL FAIL
@ -529,9 +519,7 @@ unsafe fn yaml_parser_load_mapping(
} else { } else {
current_block = 6937071982253665452; current_block = 6937071982253665452;
} }
match current_block { if current_block != 13635467803606088781 {
13635467803606088781 => {}
_ => {
STACK_INIT!(pairs, yaml_node_pair_t); STACK_INIT!(pairs, yaml_node_pair_t);
memset( memset(
node as *mut libc::c_void, node as *mut libc::c_void,
@ -552,9 +540,7 @@ unsafe fn yaml_parser_load_mapping(
.top .top
.c_offset_from((*(*parser).document).nodes.start) .c_offset_from((*(*parser).document).nodes.start)
as libc::c_int; as libc::c_int;
if yaml_parser_register_anchor(parser, index, (*event).data.mapping_start.anchor) if yaml_parser_register_anchor(parser, index, (*event).data.mapping_start.anchor).fail {
.fail
{
return FAIL; return FAIL;
} }
if yaml_parser_load_node_add(parser, ctx, index).fail { if yaml_parser_load_node_add(parser, ctx, index).fail {
@ -567,7 +553,6 @@ unsafe fn yaml_parser_load_mapping(
return OK; return OK;
} }
} }
}
yaml_free(tag as *mut libc::c_void); yaml_free(tag as *mut libc::c_void);
yaml_free((*event).data.mapping_start.anchor as *mut libc::c_void); yaml_free((*event).data.mapping_start.anchor as *mut libc::c_void);
FAIL FAIL

View file

@ -481,8 +481,7 @@ unsafe fn yaml_parser_parse_node(
} else { } else {
current_block = 11743904203796629665; current_block = 11743904203796629665;
} }
match current_block { if current_block == 11743904203796629665 {
11743904203796629665 => {
if !tag_handle.is_null() { if !tag_handle.is_null() {
if *tag_handle == 0 { if *tag_handle == 0 {
tag = tag_suffix; tag = tag_suffix;
@ -519,9 +518,8 @@ unsafe fn yaml_parser_parse_node(
tag_suffix as *const libc::c_void, tag_suffix as *const libc::c_void,
suffix_len, suffix_len,
); );
*tag.wrapping_offset( *tag.wrapping_offset(prefix_len.wrapping_add(suffix_len) as isize) =
prefix_len.wrapping_add(suffix_len) as isize b'\0';
) = b'\0';
yaml_free(tag_handle as *mut libc::c_void); yaml_free(tag_handle as *mut libc::c_void);
yaml_free(tag_suffix as *mut libc::c_void); yaml_free(tag_suffix as *mut libc::c_void);
tag_suffix = ptr::null_mut::<yaml_char_t>(); tag_suffix = ptr::null_mut::<yaml_char_t>();
@ -532,17 +530,13 @@ unsafe fn yaml_parser_parse_node(
tag_directive = tag_directive.wrapping_offset(1); tag_directive = tag_directive.wrapping_offset(1);
} }
} }
match current_block { if current_block != 17786380918591080555 {
17786380918591080555 => {}
_ => {
if tag.is_null() { if tag.is_null() {
yaml_parser_set_parser_error_context( yaml_parser_set_parser_error_context(
parser, parser,
b"while parsing a node\0" as *const u8 b"while parsing a node\0" as *const u8 as *const libc::c_char,
as *const libc::c_char,
start_mark, start_mark,
b"found undefined tag handle\0" as *const u8 b"found undefined tag handle\0" as *const u8 as *const libc::c_char,
as *const libc::c_char,
tag_mark, tag_mark,
); );
current_block = 17786380918591080555; current_block = 17786380918591080555;
@ -551,13 +545,10 @@ unsafe fn yaml_parser_parse_node(
} }
} }
} }
}
} else { } else {
current_block = 9437013279121998969; current_block = 9437013279121998969;
} }
match current_block { if current_block != 17786380918591080555 {
17786380918591080555 => {}
_ => {
implicit = tag.is_null() || *tag == 0; implicit = tag.is_null() || *tag == 0;
if indentless_sequence && (*token).type_ == YAML_BLOCK_ENTRY_TOKEN { if indentless_sequence && (*token).type_ == YAML_BLOCK_ENTRY_TOKEN {
end_mark = (*token).end_mark; end_mark = (*token).end_mark;
@ -581,8 +572,7 @@ unsafe fn yaml_parser_parse_node(
let mut plain_implicit = false; let mut plain_implicit = false;
let mut quoted_implicit = false; let mut quoted_implicit = false;
end_mark = (*token).end_mark; end_mark = (*token).end_mark;
if (*token).data.scalar.style == YAML_PLAIN_SCALAR_STYLE if (*token).data.scalar.style == YAML_PLAIN_SCALAR_STYLE && tag.is_null()
&& tag.is_null()
|| !tag.is_null() || !tag.is_null()
&& strcmp( && strcmp(
tag as *mut libc::c_char, tag as *mut libc::c_char,
@ -713,23 +703,17 @@ unsafe fn yaml_parser_parse_node(
yaml_parser_set_parser_error_context( yaml_parser_set_parser_error_context(
parser, parser,
if block { if block {
b"while parsing a block node\0" as *const u8 b"while parsing a block node\0" as *const u8 as *const libc::c_char
as *const libc::c_char
} else { } else {
b"while parsing a flow node\0" as *const u8 b"while parsing a flow node\0" as *const u8 as *const libc::c_char
as *const libc::c_char
}, },
start_mark, start_mark,
b"did not find expected node content\0" as *const u8 b"did not find expected node content\0" as *const u8 as *const libc::c_char,
as *const libc::c_char,
(*token).start_mark, (*token).start_mark,
); );
} }
} }
} }
}
_ => {}
}
yaml_free(anchor as *mut libc::c_void); yaml_free(anchor as *mut libc::c_void);
yaml_free(tag_handle as *mut libc::c_void); yaml_free(tag_handle as *mut libc::c_void);
yaml_free(tag_suffix as *mut libc::c_void); yaml_free(tag_suffix as *mut libc::c_void);
@ -1283,9 +1267,7 @@ unsafe fn yaml_parser_process_directives(
break; break;
} }
} }
match current_block { if current_block != 17143798186130252483 {
17143798186130252483 => {}
_ => {
default_tag_directive = default_tag_directives.as_mut_ptr(); default_tag_directive = default_tag_directives.as_mut_ptr();
loop { loop {
if (*default_tag_directive).handle.is_null() { if (*default_tag_directive).handle.is_null() {
@ -1305,9 +1287,7 @@ unsafe fn yaml_parser_process_directives(
} }
default_tag_directive = default_tag_directive.wrapping_offset(1); default_tag_directive = default_tag_directive.wrapping_offset(1);
} }
match current_block { if current_block != 17143798186130252483 {
17143798186130252483 => {}
_ => {
if !version_directive_ref.is_null() { if !version_directive_ref.is_null() {
*version_directive_ref = version_directive; *version_directive_ref = version_directive;
} }
@ -1330,8 +1310,6 @@ unsafe fn yaml_parser_process_directives(
} }
} }
} }
}
}
yaml_free(version_directive as *mut libc::c_void); yaml_free(version_directive as *mut libc::c_void);
while !STACK_EMPTY!(tag_directives) { while !STACK_EMPTY!(tag_directives) {
let tag_directive = POP!(tag_directives); let tag_directive = POP!(tag_directives);

View file

@ -1018,9 +1018,7 @@ unsafe fn yaml_parser_scan_directive(
); );
current_block = 11397968426844348457; current_block = 11397968426844348457;
} }
match current_block { if current_block != 11397968426844348457 {
11397968426844348457 => {}
_ => {
if CACHE(parser, 1_u64).ok { if CACHE(parser, 1_u64).ok {
loop { loop {
if !IS_BLANK!((*parser).buffer) { if !IS_BLANK!((*parser).buffer) {
@ -1033,9 +1031,7 @@ unsafe fn yaml_parser_scan_directive(
break; break;
} }
} }
match current_block { if current_block != 11397968426844348457 {
11397968426844348457 => {}
_ => {
if CHECK!((*parser).buffer, b'#') { if CHECK!((*parser).buffer, b'#') {
loop { loop {
if IS_BREAKZ!((*parser).buffer) { if IS_BREAKZ!((*parser).buffer) {
@ -1051,17 +1047,13 @@ unsafe fn yaml_parser_scan_directive(
} else { } else {
current_block = 6669252993407410313; current_block = 6669252993407410313;
} }
match current_block { if current_block != 11397968426844348457 {
11397968426844348457 => {}
_ => {
if !IS_BREAKZ!((*parser).buffer) { if !IS_BREAKZ!((*parser).buffer) {
yaml_parser_set_scanner_error( yaml_parser_set_scanner_error(
parser, parser,
b"while scanning a directive\0" as *const u8 b"while scanning a directive\0" as *const u8 as *const libc::c_char,
as *const libc::c_char,
start_mark, start_mark,
b"did not find expected comment or line break\0" b"did not find expected comment or line break\0" as *const u8
as *const u8
as *const libc::c_char, as *const libc::c_char,
); );
} else { } else {
@ -1075,9 +1067,7 @@ unsafe fn yaml_parser_scan_directive(
} else { } else {
current_block = 652864300344834934; current_block = 652864300344834934;
} }
match current_block { if current_block != 11397968426844348457 {
11397968426844348457 => {}
_ => {
yaml_free(name as *mut libc::c_void); yaml_free(name as *mut libc::c_void);
return OK; return OK;
} }
@ -1087,10 +1077,6 @@ unsafe fn yaml_parser_scan_directive(
} }
} }
} }
}
}
}
}
yaml_free(prefix as *mut libc::c_void); yaml_free(prefix as *mut libc::c_void);
yaml_free(handle as *mut libc::c_void); yaml_free(handle as *mut libc::c_void);
yaml_free(name as *mut libc::c_void); yaml_free(name as *mut libc::c_void);
@ -1117,16 +1103,13 @@ unsafe fn yaml_parser_scan_directive_name(
break; break;
} }
} }
match current_block { if current_block != 8318012024179131575 {
8318012024179131575 => {}
_ => {
if string.start == string.pointer { if string.start == string.pointer {
yaml_parser_set_scanner_error( yaml_parser_set_scanner_error(
parser, parser,
b"while scanning a directive\0" as *const u8 as *const libc::c_char, b"while scanning a directive\0" as *const u8 as *const libc::c_char,
start_mark, start_mark,
b"could not find expected directive name\0" as *const u8 b"could not find expected directive name\0" as *const u8 as *const libc::c_char,
as *const libc::c_char,
); );
} else if !IS_BLANKZ!((*parser).buffer) { } else if !IS_BLANKZ!((*parser).buffer) {
yaml_parser_set_scanner_error( yaml_parser_set_scanner_error(
@ -1142,7 +1125,6 @@ unsafe fn yaml_parser_scan_directive_name(
} }
} }
} }
}
STRING_DEL!(string); STRING_DEL!(string);
FAIL FAIL
} }
@ -1347,9 +1329,7 @@ unsafe fn yaml_parser_scan_anchor(
} }
length += 1; length += 1;
} }
match current_block { if current_block != 5883759901342942623 {
5883759901342942623 => {}
_ => {
end_mark = (*parser).mark; end_mark = (*parser).mark;
if length == 0 if length == 0
|| !(IS_BLANKZ!((*parser).buffer) || !(IS_BLANKZ!((*parser).buffer)
@ -1401,7 +1381,6 @@ unsafe fn yaml_parser_scan_anchor(
} }
} }
} }
}
STRING_DEL!(string); STRING_DEL!(string);
FAIL FAIL
} }
@ -1490,9 +1469,7 @@ unsafe fn yaml_parser_scan_tag(
} }
current_block = 4488286894823169796; current_block = 4488286894823169796;
} }
match current_block { if current_block != 17708497480799081542 {
17708497480799081542 => {}
_ => {
if CACHE(parser, 1_u64).ok { if CACHE(parser, 1_u64).ok {
if !IS_BLANKZ!((*parser).buffer) { if !IS_BLANKZ!((*parser).buffer) {
if (*parser).flow_level == 0 || !CHECK!((*parser).buffer, b',') { if (*parser).flow_level == 0 || !CHECK!((*parser).buffer, b',') {
@ -1510,9 +1487,7 @@ unsafe fn yaml_parser_scan_tag(
} else { } else {
current_block = 7333393191927787629; current_block = 7333393191927787629;
} }
match current_block { if current_block != 17708497480799081542 {
17708497480799081542 => {}
_ => {
end_mark = (*parser).mark; end_mark = (*parser).mark;
memset( memset(
token as *mut libc::c_void, token as *mut libc::c_void,
@ -1531,8 +1506,6 @@ unsafe fn yaml_parser_scan_tag(
} }
} }
} }
}
}
yaml_free(handle as *mut libc::c_void); yaml_free(handle as *mut libc::c_void);
yaml_free(suffix as *mut libc::c_void); yaml_free(suffix as *mut libc::c_void);
FAIL FAIL
@ -1573,9 +1546,7 @@ unsafe fn yaml_parser_scan_tag_handle(
break; break;
} }
} }
match current_block { if current_block != 1771849829115608806 {
1771849829115608806 => {}
_ => {
if CHECK!((*parser).buffer, b'!') { if CHECK!((*parser).buffer, b'!') {
READ!(parser, string); READ!(parser, string);
current_block = 5689001924483802034; current_block = 5689001924483802034;
@ -1585,8 +1556,7 @@ unsafe fn yaml_parser_scan_tag_handle(
{ {
yaml_parser_set_scanner_error( yaml_parser_set_scanner_error(
parser, parser,
b"while parsing a tag directive\0" as *const u8 b"while parsing a tag directive\0" as *const u8 as *const libc::c_char,
as *const libc::c_char,
start_mark, start_mark,
b"did not find expected '!'\0" as *const u8 as *const libc::c_char, b"did not find expected '!'\0" as *const u8 as *const libc::c_char,
); );
@ -1594,9 +1564,7 @@ unsafe fn yaml_parser_scan_tag_handle(
} else { } else {
current_block = 5689001924483802034; current_block = 5689001924483802034;
} }
match current_block { if current_block != 1771849829115608806 {
1771849829115608806 => {}
_ => {
*handle = string.start; *handle = string.start;
return OK; return OK;
} }
@ -1604,8 +1572,6 @@ unsafe fn yaml_parser_scan_tag_handle(
} }
} }
} }
}
}
STRING_DEL!(string); STRING_DEL!(string);
FAIL FAIL
} }
@ -1886,9 +1852,7 @@ unsafe fn yaml_parser_scan_block_scalar(
} else { } else {
current_block = 11913429853522160501; current_block = 11913429853522160501;
} }
match current_block { if current_block != 14984465786483313892 {
14984465786483313892 => {}
_ => {
if CACHE(parser, 1_u64).ok { if CACHE(parser, 1_u64).ok {
loop { loop {
if !IS_BLANK!((*parser).buffer) { if !IS_BLANK!((*parser).buffer) {
@ -1901,9 +1865,7 @@ unsafe fn yaml_parser_scan_block_scalar(
break; break;
} }
} }
match current_block { if current_block != 14984465786483313892 {
14984465786483313892 => {}
_ => {
if CHECK!((*parser).buffer, b'#') { if CHECK!((*parser).buffer, b'#') {
loop { loop {
if IS_BREAKZ!((*parser).buffer) { if IS_BREAKZ!((*parser).buffer) {
@ -1919,17 +1881,14 @@ unsafe fn yaml_parser_scan_block_scalar(
} else { } else {
current_block = 12997042908615822766; current_block = 12997042908615822766;
} }
match current_block { if current_block != 14984465786483313892 {
14984465786483313892 => {}
_ => {
if !IS_BREAKZ!((*parser).buffer) { if !IS_BREAKZ!((*parser).buffer) {
yaml_parser_set_scanner_error( yaml_parser_set_scanner_error(
parser, parser,
b"while scanning a block scalar\0" as *const u8 b"while scanning a block scalar\0" as *const u8
as *const libc::c_char, as *const libc::c_char,
start_mark, start_mark,
b"did not find expected comment or line break\0" b"did not find expected comment or line break\0" as *const u8
as *const u8
as *const libc::c_char, as *const libc::c_char,
); );
} else { } else {
@ -1943,9 +1902,7 @@ unsafe fn yaml_parser_scan_block_scalar(
} else { } else {
current_block = 13619784596304402172; current_block = 13619784596304402172;
} }
match current_block { if current_block != 14984465786483313892 {
14984465786483313892 => {}
_ => {
end_mark = (*parser).mark; end_mark = (*parser).mark;
if increment != 0 { if increment != 0 {
indent = if (*parser).indent >= 0 { indent = if (*parser).indent >= 0 {
@ -1965,17 +1922,14 @@ unsafe fn yaml_parser_scan_block_scalar(
{ {
if CACHE(parser, 1_u64).ok { if CACHE(parser, 1_u64).ok {
's_281: loop { 's_281: loop {
if !((*parser).mark.column if !((*parser).mark.column as libc::c_int == indent
as libc::c_int
== indent
&& !IS_Z!((*parser).buffer)) && !IS_Z!((*parser).buffer))
{ {
current_block = 5793491756164225964; current_block = 5793491756164225964;
break; break;
} }
trailing_blank = trailing_blank =
IS_BLANK!((*parser).buffer) IS_BLANK!((*parser).buffer) as libc::c_int;
as libc::c_int;
if !literal if !literal
&& *leading_break.start == b'\n' && *leading_break.start == b'\n'
&& leading_blank == 0 && leading_blank == 0
@ -1984,9 +1938,8 @@ unsafe fn yaml_parser_scan_block_scalar(
if *trailing_breaks.start == b'\0' { if *trailing_breaks.start == b'\0' {
STRING_EXTEND!(string); STRING_EXTEND!(string);
let fresh418 = string.pointer; let fresh418 = string.pointer;
string.pointer = string string.pointer =
.pointer string.pointer.wrapping_offset(1);
.wrapping_offset(1);
*fresh418 = b' '; *fresh418 = b' ';
} }
CLEAR!(leading_break); CLEAR!(leading_break);
@ -1997,19 +1950,16 @@ unsafe fn yaml_parser_scan_block_scalar(
JOIN!(string, trailing_breaks); JOIN!(string, trailing_breaks);
CLEAR!(trailing_breaks); CLEAR!(trailing_breaks);
leading_blank = leading_blank =
IS_BLANK!((*parser).buffer) IS_BLANK!((*parser).buffer) as libc::c_int;
as libc::c_int;
while !IS_BREAKZ!((*parser).buffer) { while !IS_BREAKZ!((*parser).buffer) {
READ!(parser, string); READ!(parser, string);
if CACHE(parser, 1_u64).fail { if CACHE(parser, 1_u64).fail {
current_block = current_block = 14984465786483313892;
14984465786483313892;
break 's_281; break 's_281;
} }
} }
if CACHE(parser, 2_u64).fail { if CACHE(parser, 2_u64).fail {
current_block = current_block = 14984465786483313892;
14984465786483313892;
break; break;
} }
READ_LINE!(parser, leading_break); READ_LINE!(parser, leading_break);
@ -2022,71 +1972,43 @@ unsafe fn yaml_parser_scan_block_scalar(
) )
.fail .fail
{ {
current_block = current_block = 14984465786483313892;
14984465786483313892;
break; break;
} }
} }
match current_block { if current_block != 14984465786483313892 {
14984465786483313892 => {}
_ => {
if chomping != -1 { if chomping != -1 {
JOIN!(string, leading_break); JOIN!(string, leading_break);
current_block = current_block = 17787701279558130514;
17787701279558130514;
} else { } else {
current_block = current_block = 17787701279558130514;
17787701279558130514;
} }
match current_block { if current_block != 14984465786483313892 {
14984465786483313892 => {}
_ => {
if chomping == 1 { if chomping == 1 {
JOIN!( JOIN!(string, trailing_breaks);
string,
trailing_breaks
);
} }
memset( memset(
token as *mut libc::c_void, token as *mut libc::c_void,
0, 0,
size_of::<yaml_token_t>() as libc::c_ulong, size_of::<yaml_token_t>() as libc::c_ulong,
); );
(*token).type_ = (*token).type_ = YAML_SCALAR_TOKEN;
YAML_SCALAR_TOKEN; (*token).start_mark = start_mark;
(*token).start_mark = (*token).end_mark = end_mark;
start_mark; let fresh479 =
(*token).end_mark = addr_of_mut!((*token).data.scalar.value);
end_mark;
let fresh479 = addr_of_mut!(
(*token)
.data
.scalar
.value
);
*fresh479 = string.start; *fresh479 = string.start;
(*token) (*token).data.scalar.length =
.data string.pointer.c_offset_from(string.start)
.scalar
.length = string
.pointer
.c_offset_from(
string.start,
)
as libc::c_long as libc::c_long
as size_t; as size_t;
(*token) (*token).data.scalar.style = if literal {
.data
.scalar
.style = if literal {
YAML_LITERAL_SCALAR_STYLE YAML_LITERAL_SCALAR_STYLE
} else { } else {
YAML_FOLDED_SCALAR_STYLE YAML_FOLDED_SCALAR_STYLE
}; };
STRING_DEL!(leading_break); STRING_DEL!(leading_break);
STRING_DEL!( STRING_DEL!(trailing_breaks);
trailing_breaks
);
return OK; return OK;
} }
} }
@ -2099,12 +2021,6 @@ unsafe fn yaml_parser_scan_block_scalar(
} }
} }
} }
}
}
}
}
}
}
STRING_DEL!(string); STRING_DEL!(string);
STRING_DEL!(leading_break); STRING_DEL!(leading_break);
STRING_DEL!(trailing_breaks); STRING_DEL!(trailing_breaks);
@ -2537,9 +2453,7 @@ unsafe fn yaml_parser_scan_flow_scalar(
} }
} }
} }
match current_block { if current_block != 8114179180390253173 {
8114179180390253173 => {}
_ => {
SKIP(parser); SKIP(parser);
end_mark = (*parser).mark; end_mark = (*parser).mark;
memset( memset(
@ -2564,7 +2478,6 @@ unsafe fn yaml_parser_scan_flow_scalar(
STRING_DEL!(whitespaces); STRING_DEL!(whitespaces);
return OK; return OK;
} }
}
STRING_DEL!(string); STRING_DEL!(string);
STRING_DEL!(leading_break); STRING_DEL!(leading_break);
STRING_DEL!(trailing_breaks); STRING_DEL!(trailing_breaks);
@ -2724,9 +2637,7 @@ unsafe fn yaml_parser_scan_plain_scalar(
break; break;
} }
} }
match current_block { if current_block != 16642808987012640029 {
16642808987012640029 => {}
_ => {
memset( memset(
token as *mut libc::c_void, token as *mut libc::c_void,
0, 0,
@ -2748,7 +2659,6 @@ unsafe fn yaml_parser_scan_plain_scalar(
STRING_DEL!(whitespaces); STRING_DEL!(whitespaces);
return OK; return OK;
} }
}
STRING_DEL!(string); STRING_DEL!(string);
STRING_DEL!(leading_break); STRING_DEL!(leading_break);
STRING_DEL!(trailing_breaks); STRING_DEL!(trailing_breaks);