[examples] write labels.mdesk with examples of labels

This commit is contained in:
Allen Webster
2021-09-13 18:09:38 -07:00
parent feafba93f3
commit e5c9b49c83
6 changed files with 109 additions and 11 deletions
+4 -3
View File
@@ -619,7 +619,7 @@ MD_CharIsUnreservedSymbol(MD_u8 c)
return (c == '~' || c == '!' || c == '$' || c == '%' || c == '^' ||
c == '&' || c == '*' || c == '-' || c == '=' || c == '+' ||
c == '<' || c == '.' || c == '>' || c == '/' || c == '?' ||
c == '|' || c == '\\');
c == '|');
}
MD_FUNCTION_IMPL MD_b32
@@ -1891,7 +1891,7 @@ MD_TokenFromString(MD_String8 string)
}break;
// NOTE(allen): Identifiers, Numbers, Operators
// NOTE(allen): Identifiers, Numbers, Symbols
default:
{
if (MD_CharIsAlpha(*at) || *at == '_')
@@ -1905,7 +1905,7 @@ MD_TokenFromString(MD_String8 string)
else if (MD_CharIsDigit(*at))
{
token.node_flags |= MD_NodeFlag_Numeric;
token.kind = MD_TokenKind_NumericLiteral;
token.kind = MD_TokenKind_Numeric;
at += 1;
for (; at < one_past_last;){
@@ -1932,6 +1932,7 @@ MD_TokenFromString(MD_String8 string)
{
symbol_lex:
token.node_flags |= MD_NodeFlag_Symbol;
token.kind = MD_TokenKind_Symbol;
at += 1;
MD_TokenizerScan(MD_CharIsUnreservedSymbol(*at));
+3 -2
View File
@@ -584,6 +584,7 @@ enum
MD_NodeFlag_Numeric = (1<<14),
MD_NodeFlag_Identifier = (1<<15),
MD_NodeFlag_StringLiteral = (1<<16),
MD_NodeFlag_Symbol = (1<<17),
};
typedef struct MD_Node MD_Node;
@@ -670,7 +671,7 @@ typedef MD_u32 MD_TokenKind;
enum
{
MD_TokenKind_Identifier = (1<<0),
MD_TokenKind_NumericLiteral = (1<<1),
MD_TokenKind_Numeric = (1<<1),
MD_TokenKind_StringLiteral = (1<<2),
MD_TokenKind_Symbol = (1<<3),
MD_TokenKind_Reserved = (1<<4),
@@ -692,7 +693,7 @@ enum
MD_TokenGroup_Whitespace),
MD_TokenGroup_Regular = ~MD_TokenGroup_Irregular,
MD_TokenGroup_Label = (MD_TokenKind_Identifier|
MD_TokenKind_NumericLiteral|
MD_TokenKind_Numeric|
MD_TokenKind_StringLiteral|
MD_TokenKind_Symbol),
MD_TokenGroup_Error = (MD_TokenKind_BrokenComment|