[examples] filling in notes in the parse_check.c example; upgrading the datadesk_like_template a bit

This commit is contained in:
Allen Webster
2021-09-10 14:34:23 -07:00
parent aeaa8b1154
commit a3e8c90b67
6 changed files with 112 additions and 62 deletions
-13
View File
@@ -2903,19 +2903,6 @@ MD_PrintMessageFmt(FILE *file, MD_CodeLoc code_loc, MD_MessageKind kind, char *f
MD_ReleaseScratch(scratch);
}
MD_FUNCTION void
MD_PrintNodeMessageFmt(FILE *file, MD_Node *node, MD_MessageKind kind, char *fmt, ...){
MD_ArenaTemp scratch = MD_GetScratch(0, 0);
va_list args;
va_start(args, fmt);
MD_String8 string = MD_S8FmtV(scratch.arena, fmt, args);
va_end(args);
MD_CodeLoc code_loc = MD_CodeLocFromNode(node);
MD_String8 message = MD_FormatMessage(scratch.arena, code_loc, kind, string);
fwrite(message.str, message.size, 1, file);
MD_ReleaseScratch(scratch);
}
#endif
//~ Tree Comparison/Verification
+2 -2
View File
@@ -2,6 +2,8 @@
//~ Metadesk Library
// TODO(allen): Welcome & user directory comment here
#ifndef MD_H
#define MD_H
@@ -1117,8 +1119,6 @@ MD_FUNCTION void MD_PrintMessage(FILE *file, MD_CodeLoc loc, MD_MessageKind kind
MD_String8 string);
MD_FUNCTION void MD_PrintMessageFmt(FILE *file, MD_CodeLoc code_loc, MD_MessageKind kind,
char *fmt, ...);
MD_FUNCTION void MD_PrintNodeMessageFmt(FILE *file, MD_Node *node, MD_MessageKind kind,
char *fmt, ...);
#endif
//~ Tree Comparison/Verification