bugfix; build dummy root node for error marker nodes, to ensure that they have an accurate way to tell their location

This commit is contained in:
ryanfleury
2021-06-24 22:46:56 -06:00
parent 9175305b08
commit d1fe089804
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -1234,9 +1234,11 @@ MD_PushNodeErrorF(MD_ParseCtx *ctx, MD_Node *node, MD_MessageKind kind, char *fm
MD_FUNCTION void
MD_PushTokenError(MD_ParseCtx *ctx, MD_Token token, MD_MessageKind kind, MD_String8 str){
MD_Node *stub_file = MD_MakeNode(MD_NodeKind_ErrorMarker, ctx->file_contents, ctx->file_contents, ctx->file_contents.str);
MD_Node *stub = _MD_MakeNode_Ctx(ctx, MD_NodeKind_ErrorMarker,
token.string, token.outer_string, token.outer_string.str);
MD_PushNodeError(ctx, stub, kind, str);
MD_PushChild(stub_file, stub);
}
MD_FUNCTION void
+7
View File
@@ -31,6 +31,13 @@ TestResult(MD_b32 result)
test_ctx.number_of_tests += 1;
test_ctx.number_passed += !!result;
printf(result ? "." : "X");
#if 0
if(result == 0)
{
__debugbreak();
}
#endif
}
static void