mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-04 06:38:45 +00:00
thread context scratch system; converge on transition idiom in sample code
This commit is contained in:
@@ -7,9 +7,14 @@
|
||||
#include "md.c"
|
||||
#include "md_c_helpers.c"
|
||||
|
||||
static MD_Arena *arena = 0;
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
MD_Arena *arena = MD_ArenaNew(1ull << 40);
|
||||
MD_ThreadContext tctx;
|
||||
MD_ThreadInit(&tctx);
|
||||
|
||||
arena = MD_ArenaNew(1ull << 40);
|
||||
|
||||
MD_String8 example_code = MD_S8Lit("@struct Foo:\n"
|
||||
"{\n"
|
||||
|
||||
@@ -3,9 +3,14 @@
|
||||
#include "md.h"
|
||||
#include "md.c"
|
||||
|
||||
static MD_Arena *arena = 0;
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
MD_Arena *arena = MD_ArenaNew(1ull << 40);
|
||||
MD_ThreadContext tctx;
|
||||
MD_ThreadInit(&tctx);
|
||||
|
||||
arena = MD_ArenaNew(1ull << 40);
|
||||
|
||||
// NOTE(rjf): Parse all the files passed in via command line.
|
||||
MD_Node *list = MD_MakeList(arena);
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "md.h"
|
||||
#include "md.c"
|
||||
|
||||
static MD_Arena *arena = 0;
|
||||
|
||||
static void
|
||||
Initialize(void)
|
||||
{
|
||||
@@ -23,7 +25,10 @@ CleanUp(void)
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
MD_Arena *arena = MD_ArenaNew(1ull << 40);
|
||||
MD_ThreadContext tctx;
|
||||
MD_ThreadInit(&tctx);
|
||||
|
||||
arena = MD_ArenaNew(1ull << 40);
|
||||
|
||||
// NOTE(rjf): Parse all the files passed in via command line.
|
||||
MD_Node *list = MD_MakeList(arena);
|
||||
|
||||
@@ -64,6 +64,9 @@ static void PrintNode(MD_Node* node, FILE* file, int indent_count) {
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
MD_ThreadContext tctx;
|
||||
MD_ThreadInit(&tctx);
|
||||
|
||||
arena = MD_ArenaNew(1ull << 40);
|
||||
|
||||
// NOTE(pmh): Parse all the files passed in via command line.
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
#include "md.h"
|
||||
#include "md.c"
|
||||
|
||||
static MD_Arena *arena = 0;
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
MD_Arena *arena = MD_ArenaNew(1ull << 40);
|
||||
MD_ThreadContext tctx;
|
||||
MD_ThreadInit(&tctx);
|
||||
|
||||
arena = MD_ArenaNew(1ull << 40);
|
||||
|
||||
MD_Node *list = MD_MakeList(arena);
|
||||
for(int i = 1; i < argument_count; i += 1)
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
function StringFitsFilter(str, filter)
|
||||
{
|
||||
let match = true;
|
||||
let filter_upper = filter.toUpperCase();
|
||||
let filter_substrings = filter_upper.split(/[ _*]+/);
|
||||
let str_upper = str.toUpperCase();
|
||||
let minimum_index = 0;
|
||||
|
||||
for(let i = 0; i < filter_substrings.length; ++i)
|
||||
{
|
||||
if(filter_substrings[i].length > 0)
|
||||
{
|
||||
let index_of_substring = str_upper.indexOf(filter_substrings[i], minimum_index);
|
||||
if(index_of_substring < 0 || index_of_substring < minimum_index)
|
||||
{
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
minimum_index = index_of_substring + filter_substrings[i].length - 1;
|
||||
}
|
||||
}
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
function UpdateListByFilter(menu_id, filter_id)
|
||||
{
|
||||
let ul = document.getElementById(menu_id);
|
||||
let li = ul.getElementsByTagName("li");
|
||||
let input = document.getElementById(filter_id);
|
||||
let filter = input.value.toUpperCase();
|
||||
for(let i = 0; i < li.length; i++)
|
||||
{
|
||||
if(filter.length > 0)
|
||||
{
|
||||
let a = li[i].getElementsByTagName("a")[0];
|
||||
if(StringFitsFilter(a.innerHTML, filter))
|
||||
{
|
||||
li[i].style.display = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
li[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
li[i].style.display = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SearchInput(event, lister_idx)
|
||||
{
|
||||
UpdateListByFilter("lister_"+lister_idx, "lister_search_"+lister_idx);
|
||||
}
|
||||
|
||||
function SearchKeyDown(event, lister_idx)
|
||||
{
|
||||
UpdateListByFilter("lister_"+lister_idx, "lister_search_"+lister_idx);
|
||||
}
|
||||
@@ -34,6 +34,9 @@ static MD_Arena *arena = 0;
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
MD_ThreadContext tctx;
|
||||
MD_ThreadInit(&tctx);
|
||||
|
||||
arena = MD_ArenaNew(1ull << 40);
|
||||
|
||||
//~ NOTE(rjf): Parse command line arguments.
|
||||
|
||||
@@ -182,6 +182,9 @@ EvaluateScope(NamespaceNode *ns, MD_Node *code)
|
||||
|
||||
int main(int argument_count, char **arguments)
|
||||
{
|
||||
MD_ThreadContext tctx;
|
||||
MD_ThreadInit(&tctx);
|
||||
|
||||
arena = MD_ArenaNew(1ull << 40);
|
||||
|
||||
//- rjf: parse command line
|
||||
|
||||
Reference in New Issue
Block a user