[examples] rearrange examples to give big examples their own folder; add hand written files for type info example

This commit is contained in:
Allen Webster
2021-09-19 16:28:06 -07:00
parent 0a07520fac
commit 2be6caf79a
14 changed files with 91 additions and 7 deletions
+26
View File
@@ -0,0 +1,26 @@
/*
** Example: hello world
*/
//~ includes and globals //////////////////////////////////////////////////////
#include "md.h"
#include "md.c"
static MD_Arena *arena = 0;
//~ main //////////////////////////////////////////////////////////////////////
int
main(int argc, char **argv){
// setup the global arena
arena = MD_ArenaAlloc();
// parse a string
MD_String8 name = MD_S8Lit("<name>");
MD_String8 hello_world = MD_S8Lit("hello world");
MD_ParseResult parse = MD_ParseWholeString(arena, name, hello_world);
// print the results
MD_PrintDebugDumpFromNode(stdout, parse.node, MD_GenerateFlags_All);
}