ensure MD_Error node parent is filled out always; cleanup a few things

This commit is contained in:
ryanfleury
2021-06-29 22:40:07 -06:00
parent f73f643aed
commit 0dea16c4c1
3 changed files with 43 additions and 32 deletions
+12 -2
View File
@@ -280,10 +280,12 @@ int main(void)
{
MD_ParseResult parse = MD_ParseOneNode(MD_S8Lit("(a, b)"), 0);
TestResult(parse.node->first_child->flags & MD_NodeFlag_BeforeComma);
TestResult(parse.node->first_child->next->flags & MD_NodeFlag_AfterComma);
}
{
MD_ParseResult parse = MD_ParseOneNode(MD_S8Lit("(a; b)"), 0);
TestResult(parse.node->first_child->flags & MD_NodeFlag_BeforeSemicolon);
TestResult(parse.node->first_child->next->flags & MD_NodeFlag_AfterSemicolon);
}
{
// TODO(rjf): Enable this once we have digraphs.
@@ -301,9 +303,17 @@ int main(void)
TestResult(MD_ParseOneNode(MD_S8Lit("abc"), 0).node->flags &
MD_NodeFlag_Identifier);
TestResult(MD_ParseOneNode(MD_S8Lit("\"foo\""), 0).node->flags &
MD_NodeFlag_StringLiteral);
MD_NodeFlag_StringLiteral | MD_NodeFlag_StringDoubleQuote);
TestResult(MD_ParseOneNode(MD_S8Lit("'foo'"), 0).node->flags &
MD_NodeFlag_StringLiteral);
MD_NodeFlag_StringLiteral | MD_NodeFlag_StringSingleQuote);
TestResult(MD_ParseOneNode(MD_S8Lit("`foo`"), 0).node->flags &
MD_NodeFlag_StringLiteral | MD_NodeFlag_StringTick);
TestResult(MD_ParseOneNode(MD_S8Lit("\"\"\"foo\"\"\""), 0).node->flags &
MD_NodeFlag_StringLiteral | MD_NodeFlag_StringTripletDoubleQuote);
TestResult(MD_ParseOneNode(MD_S8Lit("'''foo'''"), 0).node->flags &
MD_NodeFlag_StringLiteral | MD_NodeFlag_StringTripletSingleQuote);
TestResult(MD_ParseOneNode(MD_S8Lit("```foo```"), 0).node->flags &
MD_NodeFlag_StringLiteral | MD_NodeFlag_StringTripletTick);
}
Test("Expression Evaluation")