fix samples/tests for removal of JoinStringListWithSeparator helper

This commit is contained in:
ryanfleury
2021-04-12 13:21:19 -06:00
parent 28ea290661
commit 714cb85824
3 changed files with 74 additions and 74 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ static void PrintNode(MD_Node* node, FILE* file, int indent_count) {
Print(file, indent_count+1, "Flags: %s,\n", binary_flags);
Print(file, indent_count+1, "Flag Names: ", binary_flags);
MD_String8List flags_list = MD_StringListFromNodeFlags(node->flags);
MD_String8 flag_names = MD_JoinStringListWithSeparator(flags_list, MD_S8CString(", "));
MD_String8 flag_names = MD_JoinStringList(flags_list, MD_S8CString(", "));
fprintf(file, "%.*s,\n", MD_StringExpand(flag_names));
if(node->string.size > 0) Print(file, indent_count+1, "String: %.*s,\n", MD_StringExpand(node->string));
+1 -1
View File
@@ -1793,7 +1793,7 @@ _MD_ParseOneNode(MD_ParseCtx *ctx)
{
MD_PushStringToList(&bytes, MD_PushStringF("0x%02X", token.outer_string.str[i_byte]));
}
MD_String8 byte_string = MD_JoinStringListWithSeparator(bytes, MD_S8Lit(" "));
MD_String8 byte_string = MD_JoinStringList(bytes, MD_S8Lit(" "));
_MD_TokenError(ctx, token, MD_MessageKind_Error, "Non-ASCII character \"%.*s\"", MD_StringExpand(byte_string));
goto retry;
}
+10 -10
View File
@@ -227,10 +227,10 @@ static void ExpandRule(MD_Node *rule, MD_String8List *out_strings, MD_Node *cur_
if(rule_element->string.size == 2 && rule_element->string.str[0] == '\\')
{
switch(rule_element->string.str[1]){
case '\\': c = '\\'; break;
case '\'': c = '\''; break;
case '"': c = '\"'; break;
case 'n': c = '\n'; break;
case '\\': c = '\\'; break;
case '\'': c = '\''; break;
case '"': c = '\"'; break;
case 'n': c = '\n'; break;
}
}
else
@@ -475,10 +475,10 @@ FirstBadNodeAtPointer(MD_Node *node)
{
MD_Node *result = 0;
switch(node->kind){
case MD_NodeKind_File:
case MD_NodeKind_File:
{
} break;
case MD_NodeKind_Label:
case MD_NodeKind_Label:
{
if(node->at != node->whole_string.str)
{
@@ -500,8 +500,8 @@ FirstBadNodeAtPointer(MD_Node *node)
}
}
} break;
case MD_NodeKind_List:
case MD_NodeKind_Tag:
case MD_NodeKind_List:
case MD_NodeKind_Tag:
{
if(node->at != node->whole_string.str)
{
@@ -509,7 +509,7 @@ FirstBadNodeAtPointer(MD_Node *node)
goto end;
}
} break;
default:
default:
break;
}
@@ -730,7 +730,7 @@ int main(int argument_count, char **arguments)
MD_String8List string_list = {0};
// NOTE(mal): Generate a random MD file
ExpandProduction(file_production_node, &string_list, test.expected_output, 0, depth_map, max_production_depth, 0);
test.input = MD_JoinStringList(string_list);
test.input = MD_JoinStringList(string_list, MD_S8Lit(""));
Test *prev = 0;
for(Test *cur = first_test; cur; cur = cur->next)