mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-06 15:48:47 +00:00
[examples] rearrange examples to give big examples their own folder; add hand written files for type info example
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user