diff --git a/c/containers/Makefile.am b/c/containers/Makefile.am index 234e48474..ae0b1036f 100644 --- a/c/containers/Makefile.am +++ b/c/containers/Makefile.am @@ -1,5 +1,7 @@ noinst_LTLIBRARIES= libcontainers.la libcontainers_la_SOURCES= \ + bind_stack.c \ + bind_stack.h \ dheap.c \ dheap.h \ dvector.c \ diff --git a/c/containers/bind_stack.c b/c/containers/bind_stack.c new file mode 100644 index 000000000..0abb177a5 --- /dev/null +++ b/c/containers/bind_stack.c @@ -0,0 +1,21 @@ +#include +#include "lib/mlrutil.h" +#include "lib/mlr_globals.h" +#include "containers/bind_stack.h" + +bind_stack_t* bind_stack_alloc() { + return NULL; // xxx stub +} + +void bind_stack_free(bind_stack_t* pstack) { +} + +void bind_stack_push(bind_stack_t* pstack, mlhmmv_t* pframe) { +} + +void bind_stack_pop(bind_stack_t* pstack) { +} + +mv_t* bind_stack_resolve(bind_stack_t* pstack, char* key) { + return NULL; // xxx stub +} diff --git a/c/containers/bind_stack.h b/c/containers/bind_stack.h new file mode 100644 index 000000000..2259c8dcd --- /dev/null +++ b/c/containers/bind_stack.h @@ -0,0 +1,18 @@ +#ifndef BIND_STACK_H +#define BIND_STACK_H + +#include "containers/mlrval.h" +#include "containers/mlhmmv.h" + +// Bound & scoped variables for use in for-loops. +typedef struct _bind_stack_t { +} bind_stack_t; + +bind_stack_t* bind_stack_alloc(); +void bind_stack_free(bind_stack_t* pstack); + +void bind_stack_push(bind_stack_t* pstack, mlhmmv_t* pframe); +void bind_stack_pop(bind_stack_t* pstack); +mv_t* bind_stack_resolve(bind_stack_t* pstack, char* key); + +#endif // BIND_STACK_H diff --git a/c/todo.txt b/c/todo.txt index 3ee06c852..53a9f057f 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -6,8 +6,16 @@ BUGFIXES ================================================================ TOP-OF-LIST SUMMARY -! need evaluators (new context mllhmv) for boundvars. -! need $[k] and @[k]. +* for: + - bindstack container + - boundvar evaluators @ rval: pass in a bindstack. *for miller* it ought to be possible + to be better at nested-scope name resolution than stack backwalks w/ hashgets at each + step. at each level a name will have one nearest at-or-up binding or none at all. + -> hide that in the blackboxed bindstack. + - $[boundvar] and @[boundvar] evaluators. + - cookbook example: key<->val inverter + - cookbook example: komosa originals x 2 + * for-variants: ?? take out the v part?? * for (k, v in $*) { if (k =~ "^f.*$") { $sum += v} } @@ -18,17 +26,10 @@ TOP-OF-LIST SUMMARY ? for (k1, k2, v in @v[]["a"][]) ? no -- easier to do this w/ cond-block @ 2nd loop ? for (k1, k2, v in @*) ? break/continue: fully support or eliminate from the lexer/parser -* for: - - bindstack container - - boundvar evaluators @ rval: pass in a bindstack. *for miller* it ought to be possible - to be better at nested-scope name resolution than stack backwalks w/ hashgets at each - step. at each level a name will have one nearest at-or-up binding or none at all. - -> hide that in the blackboxed bindstack. - - $[boundvar] and @[boundvar] evaluators. - - cookbook example: key<->val inverter - - cookbook example: komosa originals x 2 -* local vars w/ decl syntax -* user-defined functions ... ?? + +? local vars w/ decl syntax +? user-defined functions ... ?? + * eliminate the need for semicolon after curly brace. for now, highlighted faqent. * cst-time parse validations: top-level-only begin/end (done); no $stuff at begin/end. ? triple-for with boundvars??