From 387ca3b180c889ff084f91bc710200fdd2febcd0 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Fri, 5 Aug 2016 21:27:08 -0400 Subject: [PATCH] neaten --- c/dsls/mlr_dsl_lexer.l | 3 ++- c/mapping/mlr_dsl_cst.c | 3 ++- c/todo.txt | 16 +++++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/c/dsls/mlr_dsl_lexer.l b/c/dsls/mlr_dsl_lexer.l index 95d441048..2b4961737 100644 --- a/c/dsls/mlr_dsl_lexer.l +++ b/c/dsls/mlr_dsl_lexer.l @@ -5,6 +5,8 @@ #include "../containers/mlr_dsl_ast.h" // http://flex.sourceforge.net/manual/Extra-Data.html +// NOTE: any new keywords defined here should also be documented +// in mapping/mlr_dsl_cst.c's mlr_dsl_keyword_usage() et al. %} %option reentrant @@ -30,7 +32,6 @@ *yyextra = mlr_dsl_ast_node_alloc(yytext, MD_AST_NODE_TYPE_SREC_ASSIGNMENT); return MD_TOKEN_ASSIGN; } - "filter" { *yyextra = mlr_dsl_ast_node_alloc(yytext, MD_AST_NODE_TYPE_FILTER); return MD_TOKEN_FILTER; diff --git a/c/mapping/mlr_dsl_cst.c b/c/mapping/mlr_dsl_cst.c index ec60e6c5e..5e22ffc6b 100644 --- a/c/mapping/mlr_dsl_cst.c +++ b/c/mapping/mlr_dsl_cst.c @@ -2620,7 +2620,8 @@ void mlr_dsl_list_all_keywords_raw(FILE* ostream) { printf("stderr\n"); } -// Pass function_name == NULL to get usage for all functions. +// Pass function_name == NULL to get usage for all keywords. +// Note keywords are defined in dsls/mlr_dsl_lexer.l. void mlr_dsl_keyword_usage(FILE* ostream, char* keyword) { if (keyword == NULL) { mlr_dsl_filter_usage(ostream); fprintf(ostream, "\n"); diff --git a/c/todo.txt b/c/todo.txt index db3f4e686..e067f80d3 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -16,12 +16,12 @@ TOP OF LIST: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - COMMON: +! print/dump end with OFS ! * mlr -k needs >/>>/| examples incl. stdout/stderr/file/cmd. also some subset at mlr put -h. -* keywords: mk cmt xrefs mlr -k <-> parse.l. * kw stdout/stderr & to mlr -k / mlh / mld; also to release notes (not avail as boundvars & what happens if tried: "syntax error") -* lrec_reader/writer take sub-bagged cliopts pstructs -* put/tee --oxxx flags overlays, w/ substruct data & federated substruct fcns +~ lrec_reader/writer take sub-bagged cliopts pstructs +~ put/tee --oxxx flags overlays, w/ substruct data & federated substruct fcns COOKBOOK: * mlr --from ../data/big.dkvp put -q 'tee > $a.$b.".txt", $*' @@ -30,10 +30,20 @@ COOKBOOK: 40116 ekshat.txt 40105 ekspan.txt 40257 ekswye.txt + ... * mlr step -a shift * ... then put -q '' or ... then nothing * asv et al. +awk manpage: +> The print statement prints its arguments on the standard output (or on a file if >file or >>file is +> present or on a pipe if |cmd is present), separated by the current output field separator, and termi- +> nated by the output record separator. file and cmd may be literal names or parenthesized expres- +> sions; identical string values in different statements denote the same open file. The printf state- +> ment formats its expression list according to the format (see printf(3)). The built-in function +> close(expr) closes the file or pipe expr. The built-in function fflush(expr) flushes any buffered +> output for the file or pipe expr. + ---------------------------------------------------------------- FOR 4.4.0: