mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-05 23:28:45 +00:00
[grammar test] Remove malformed tagging. Give up on comments.
This commit is contained in:
@@ -147,7 +147,6 @@ enum OperationFlags
|
||||
OperationFlag_Fill = 1<<0,
|
||||
OperationFlag_Markup = 1<<1,
|
||||
OperationFlag_Tag = 1<<2,
|
||||
OperationFlag_PreComment = 1<<3,
|
||||
};
|
||||
|
||||
static void Extend(MD_String8 *s, char c)
|
||||
@@ -161,7 +160,6 @@ static void ExpandProduction(MD_Node *production, MD_String8List *out, MD_Node *
|
||||
static void ExpandRule(MD_Node *rule, MD_String8List *out_strings, MD_Node *cur_node, OperationFlags op_flags,
|
||||
MD_u32 max_depth, MD_u32 depth)
|
||||
{
|
||||
MD_String8 pre_comment = {0};
|
||||
for(MD_EachNode(rule_element, rule->first_child))
|
||||
{
|
||||
MD_b32 expand = 1;
|
||||
@@ -181,8 +179,6 @@ static void ExpandRule(MD_Node *rule, MD_String8List *out_strings, MD_Node *cur_
|
||||
if(expand)
|
||||
{
|
||||
MD_Node *node_to_tag = 0;
|
||||
MD_Node *node_to_precomment = 0;
|
||||
MD_String8 precomment = {0};
|
||||
OperationFlags old_op_flags = op_flags;
|
||||
for(MD_EachNode(tag_node, rule_element->first_tag)){
|
||||
if(MD_StringMatch(tag_node->string, MD_S8Lit("child"), 0))
|
||||
@@ -209,12 +205,6 @@ static void ExpandRule(MD_Node *rule, MD_String8List *out_strings, MD_Node *cur_
|
||||
{
|
||||
op_flags |= OperationFlag_Markup;
|
||||
}
|
||||
else if(MD_StringMatch(tag_node->string, MD_S8Lit("pre_comment"), 0))
|
||||
{
|
||||
op_flags |= OperationFlag_PreComment;
|
||||
node_to_precomment = cur_node;
|
||||
cur_node = NewChild(0); // NOTE(mal): Only used to store the comment, won't be linked as a node
|
||||
}
|
||||
else if(MD_StringMatch(tag_node->string, MD_S8Lit(OPTIONAL_TAG), 0))
|
||||
{
|
||||
}
|
||||
@@ -274,12 +264,6 @@ static void ExpandRule(MD_Node *rule, MD_String8List *out_strings, MD_Node *cur_
|
||||
cur_node = node_to_tag;
|
||||
}
|
||||
|
||||
if(node_to_precomment)
|
||||
{
|
||||
node_to_precomment->comment_before = cur_node->string;
|
||||
cur_node = node_to_precomment;
|
||||
}
|
||||
|
||||
op_flags = old_op_flags;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user