[docs] update match flags

This commit is contained in:
Allen Webster
2021-04-05 21:45:36 -07:00
parent a0e5db5e64
commit 4d43fb1ae4
+16 -24
View File
@@ -36,16 +36,14 @@ title: "Metadesk Reference"
@group("Strings") @group("Strings")
@doc("This type is implemented as a singly linked list with an MD_String8 at each node.") @doc("This type is implemented as a singly linked list with an MD_String8 at each node.")
@details(""" @details("A sample loop over MD_String8List:
A sample loop over MD_String8List: @code `MD_String8List list;
"""
`MD_String8List list;
for (MD_String8Node *node = list.first; node != 0; node = node->next) for (MD_String8Node *node = list.first; node != 0; node = node->next)
{ {
MD_String8 string = node->string; MD_String8 string = node->string;
// ... work on string ... // ... work on string ...
}` }`
The node_count and total_size are automaticallyed maintained by the helpers for inserting to the list, and are used in the string joining functions. Hand rolled code for building string lists should take those fields into consideration if the join functions need to work."
) )
@see(MD_PushStringToList) @see(MD_PushStringToList)
@see(MD_SplitString) @see(MD_SplitString)
@@ -60,21 +58,27 @@ for (MD_String8Node *node = list.first; node != 0; node = node->next)
}; };
@group("Strings") @group("Strings")
@doc("These flags control matching rules in routines that perform string matching.") @doc("These flags control matching rules in routines that perform matching on strings and AST nodes.")
@prefix(MD_StringMatchFlag) @prefix(MD_MatchFlag)
@base_type(MD_u32) @base_type(MD_u32)
@flags MD_StringMatchFlags: { @flags MD_MatchFlags: {
@doc("Consider lower case letters equivalent to upper case equivalents in the ASCII range.") @doc("When comparing strings, consider lower case letters equivalent to upper case equivalents in the ASCII range.")
CaseInsensitive, CaseInsensitive,
@doc("Do not require the strings to be the same length. If one of the strings is a prefix of another, the two strings will count as a match.") @doc("When comparing strings, do not require the strings to be the same length. If one of the strings is a prefix of another, the two strings will count as a match.")
RightSideSloppy, RightSideSloppy,
@doc("On routines returning the location of a substring, alters the behavior to return the last match instead of the first match.") @doc("For routines returning the location of a substring, alters the behavior to return the last match instead of the first match.")
FindLast, FindLast,
@doc("Consider forward slash and backward slash as equivalents.") @doc("When comparing strings, consider forward slash and backward slash to be equivalents.")
SlashInsensitive, SlashInsensitive,
@doc("When comparing nodes with this flag set, differences in the order and names of tags on a node count as differences in the input nodes. Without this flag tags are ignored in tree comparisons.")
Tags,
@doc("When comparing nodes with this flag set in addition to @code 'MD_NodeMatchFlag_Tags', the differences in the arguments of each tag (the tag's children in the tree) are count as differences in the input nodes. Tag arguments are compared with fully recursive compares, whether or not the compare routine would be recursive or not.")
TagArguments,
}; };
@group("Strings") @group("Strings")
@@ -169,18 +173,6 @@ for (MD_String8Node *node = list.first; node != 0; node = node->next)
CharLiteral, CharLiteral,
}; };
@group("Nodes")
@doc("Controls matching rules in routines that compare MD_Node trees.")
@prefix(MD_NodeMatchFlag)
@base_type(MD_u32)
@flags MD_NodeMatchFlags: {
@doc("When this flag is set, differences in the order and names of tags on a node count as differences in the input nodes. Without this flag tags are ignored in tree comparisons.")
Tags,
@doc("When this flag is set in addition to @code 'MD_NodeMatchFlag_Tags', the differences in the arguments of each tag (the tag's children in the tree) are count as differences in the input nodes. Tag arguments are compared with fully recursive compares, whether or not the compare routine would be recursive or not.")
TagArguments,
};
@group("Nodes") @group("Nodes")
@doc("The main 'lego-brick' for modeling the result of a metadesk parse. Also used in some auxiliary data structures.") @doc("The main 'lego-brick' for modeling the result of a metadesk parse. Also used in some auxiliary data structures.")
@struct MD_Node: { @struct MD_Node: {