From 190f2ee6732cabdf07ae8ba717d06ef73d2205f3 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Fri, 21 Oct 2016 19:07:47 -0400 Subject: [PATCH] doc neaten, and doc of put/filter -a option --- c/mapping/function_manager.c | 3 +- c/mapping/mapper_put_or_filter.c | 12 +++---- doc/manpage.html | 57 ++++++-------------------------- doc/manpage.txt | 57 ++++++-------------------------- doc/mlr.1 | 57 ++++++-------------------------- doc/reference.html | 57 ++++++-------------------------- 6 files changed, 48 insertions(+), 195 deletions(-) diff --git a/c/mapping/function_manager.c b/c/mapping/function_manager.c index 9194fbbc6..96896dcac 100644 --- a/c/mapping/function_manager.c +++ b/c/mapping/function_manager.c @@ -647,8 +647,9 @@ static void resolve_func_callsite(fmgr_t* pfmgr, rval_evaluator_t* pev) { exit(1); } + // Struct assignment into callsite space *pev = *pevaluator; - free(pevaluator); // xxx comment + free(pevaluator); } // ================================================================ diff --git a/c/mapping/mapper_put_or_filter.c b/c/mapping/mapper_put_or_filter.c index aaab2d7c7..ff05a2964 100644 --- a/c/mapping/mapper_put_or_filter.c +++ b/c/mapping/mapper_put_or_filter.c @@ -127,7 +127,6 @@ static void mapper_put_usage(FILE* o, char* argv0, char* verb) { fprintf(o, "including function list. Or \"%s -f\".\n", argv0); fprintf(o, "Please see in particular:\n"); fprintf(o, " http://www.johnkerl.org/miller/doc/reference.html#put\n"); - shared_usage(o, argv0, verb); } // ---------------------------------------------------------------- @@ -162,10 +161,11 @@ static void mapper_filter_usage(FILE* o, char* argv0, char* verb) { static void shared_usage(FILE* o, char* argv0, char* verb) { fprintf(o, "Options:\n"); - fprintf(o, "-v: First prints the AST (abstract syntax tree) for the expression, which gives\n"); - fprintf(o, " full transparency on the precedence and associativity rules of Miller's\n"); - fprintf(o, " grammar.\n"); - fprintf(o, "-t: Print low-level parser-trace to stderr.\n"); + fprintf(o, "-v: Prints the expressions's AST (abstract syntax tree), which gives\n"); + fprintf(o, " full transparency on the precedence and associativity rules of\n"); + fprintf(o, " Miller's grammar, to stdout.\n"); + fprintf(o, "-a: Prints a low-level stack-allocation trace to stdout.\n"); + fprintf(o, "-t: Prints a low-level parser trace to stderr.\n"); if (streq(verb, "put")) { fprintf(o, "-q: Does not include the modified record in the output stream. Useful for when\n"); fprintf(o, " all desired output is in begin and/or end blocks.\n"); @@ -284,7 +284,7 @@ static mapper_t* shared_parse_cli(int* pargi, int argc, char** argv, } else if (streq(argv[argi], "-v")) { print_ast = TRUE; argi += 1; - } else if (streq(argv[argi], "-a")) { // xxx to on-line help + } else if (streq(argv[argi], "-a")) { trace_stack_allocation = TRUE; argi += 1; } else if (streq(argv[argi], "-t")) { diff --git a/doc/manpage.html b/doc/manpage.html index 1967d2c37..7fd71a9f3 100644 --- a/doc/manpage.html +++ b/doc/manpage.html @@ -526,10 +526,11 @@ VERBS evaluated and the last one is used as the filter criterion. Options: - -v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. - -t: Print low-level parser-trace to stderr. + -v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. + -a: Prints a low-level stack-allocation trace to stdout. + -t: Prints a low-level parser trace to stderr. -x: Prints records for which {expression} evaluates to false. -S: Keeps field values, or literals in the expression, as strings with no type inference to int or float. @@ -814,10 +815,11 @@ VERBS regex-captures into \1, \2, etc.). Options: - -v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. - -t: Print low-level parser-trace to stderr. + -v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. + -a: Prints a low-level stack-allocation trace to stdout. + -t: Prints a low-level parser trace to stderr. -q: Does not include the modified record in the output stream. Useful for when all desired output is in begin and/or end blocks. -S: Keeps field values, or literals in the expression, as strings with no type @@ -880,45 +882,6 @@ VERBS including function list. Or "mlr -f". Please see in particular: http://www.johnkerl.org/miller/doc/reference.html#put - Options: - -v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. - -t: Print low-level parser-trace to stderr. - -q: Does not include the modified record in the output stream. Useful for when - all desired output is in begin and/or end blocks. - -S: Keeps field values, or literals in the expression, as strings with no type - inference to int or float. - -F: Keeps field values, or literals in the expression, as strings or floats - with no inference to int. - --oflatsep {string}: Separator to use when flattening multi-level @-variables - to output records for emit. Default ":". - -f {filename}: the DSL expression is taken from the specified file rather - than from the command line. Outer single quotes wrapping the expression - should not be placed in the file. If -f is specified more than once, - all input files specified using -f are concatenated to produce the expression. - (For example, you can define functions in one file and call them from another.) - -e {expression}: You can use this after -f to add an expression. Example use - case: define functions/subroutines in a file you specify with -f, then call - them with an expression you specify with -e. - (If you mix -e and -f then the expressions are evaluated in the order encountered. - Since the expression pieces are simply concatenated, please be sure to use intervening - semicolons to separate expressions.) - --no-fflush: for emit, tee, print, and dump, don't call fflush() after every - record. - Any of the output-format command-line flags (see mlr -h). Example: using - mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ... - the input is CSV, the output is pretty-print tabular, but the tee-file output - is written in JSON format. - - Please use a dollar sign for field names and double-quotes for string - literals. If field names have special characters such as "." then you might - use braces, e.g. '${field.name}'. Miller built-in variables are - NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment - variables. The environment-variable name may be an expression, e.g. a field - value. - - Use # to comment to end of line. regularize Usage: mlr regularize diff --git a/doc/manpage.txt b/doc/manpage.txt index 1bcc4672d..6f1f1b09f 100644 --- a/doc/manpage.txt +++ b/doc/manpage.txt @@ -379,10 +379,11 @@ VERBS evaluated and the last one is used as the filter criterion. Options: - -v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. - -t: Print low-level parser-trace to stderr. + -v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. + -a: Prints a low-level stack-allocation trace to stdout. + -t: Prints a low-level parser trace to stderr. -x: Prints records for which {expression} evaluates to false. -S: Keeps field values, or literals in the expression, as strings with no type inference to int or float. @@ -667,10 +668,11 @@ VERBS regex-captures into \1, \2, etc.). Options: - -v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. - -t: Print low-level parser-trace to stderr. + -v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. + -a: Prints a low-level stack-allocation trace to stdout. + -t: Prints a low-level parser trace to stderr. -q: Does not include the modified record in the output stream. Useful for when all desired output is in begin and/or end blocks. -S: Keeps field values, or literals in the expression, as strings with no type @@ -733,45 +735,6 @@ VERBS including function list. Or "mlr -f". Please see in particular: http://www.johnkerl.org/miller/doc/reference.html#put - Options: - -v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. - -t: Print low-level parser-trace to stderr. - -q: Does not include the modified record in the output stream. Useful for when - all desired output is in begin and/or end blocks. - -S: Keeps field values, or literals in the expression, as strings with no type - inference to int or float. - -F: Keeps field values, or literals in the expression, as strings or floats - with no inference to int. - --oflatsep {string}: Separator to use when flattening multi-level @-variables - to output records for emit. Default ":". - -f {filename}: the DSL expression is taken from the specified file rather - than from the command line. Outer single quotes wrapping the expression - should not be placed in the file. If -f is specified more than once, - all input files specified using -f are concatenated to produce the expression. - (For example, you can define functions in one file and call them from another.) - -e {expression}: You can use this after -f to add an expression. Example use - case: define functions/subroutines in a file you specify with -f, then call - them with an expression you specify with -e. - (If you mix -e and -f then the expressions are evaluated in the order encountered. - Since the expression pieces are simply concatenated, please be sure to use intervening - semicolons to separate expressions.) - --no-fflush: for emit, tee, print, and dump, don't call fflush() after every - record. - Any of the output-format command-line flags (see mlr -h). Example: using - mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ... - the input is CSV, the output is pretty-print tabular, but the tee-file output - is written in JSON format. - - Please use a dollar sign for field names and double-quotes for string - literals. If field names have special characters such as "." then you might - use braces, e.g. '${field.name}'. Miller built-in variables are - NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment - variables. The environment-variable name may be an expression, e.g. a field - value. - - Use # to comment to end of line. regularize Usage: mlr regularize diff --git a/doc/mlr.1 b/doc/mlr.1 index 425c4f395..b78bb7005 100644 --- a/doc/mlr.1 +++ b/doc/mlr.1 @@ -526,10 +526,11 @@ If there are multiple semicolon-delimited expressions, all of them are evaluated and the last one is used as the filter criterion. Options: --v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. --t: Print low-level parser-trace to stderr. +-v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. +-a: Prints a low-level stack-allocation trace to stdout. +-t: Prints a low-level parser trace to stderr. -x: Prints records for which {expression} evaluates to false. -S: Keeps field values, or literals in the expression, as strings with no type inference to int or float. @@ -898,10 +899,11 @@ booleans without following curly braces do nothing except side effects (e.g. regex-captures into \e1, \e2, etc.). Options: --v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. --t: Print low-level parser-trace to stderr. +-v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. +-a: Prints a low-level stack-allocation trace to stdout. +-t: Prints a low-level parser trace to stderr. -q: Does not include the modified record in the output stream. Useful for when all desired output is in begin and/or end blocks. -S: Keeps field values, or literals in the expression, as strings with no type @@ -964,45 +966,6 @@ Please see http://johnkerl.org/miller/doc/reference.html for more information including function list. Or "mlr -f". Please see in particular: http://www.johnkerl.org/miller/doc/reference.html#put -Options: --v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. --t: Print low-level parser-trace to stderr. --q: Does not include the modified record in the output stream. Useful for when - all desired output is in begin and/or end blocks. --S: Keeps field values, or literals in the expression, as strings with no type - inference to int or float. --F: Keeps field values, or literals in the expression, as strings or floats - with no inference to int. ---oflatsep {string}: Separator to use when flattening multi-level @-variables - to output records for emit. Default ":". --f {filename}: the DSL expression is taken from the specified file rather - than from the command line. Outer single quotes wrapping the expression - should not be placed in the file. If -f is specified more than once, - all input files specified using -f are concatenated to produce the expression. - (For example, you can define functions in one file and call them from another.) --e {expression}: You can use this after -f to add an expression. Example use - case: define functions/subroutines in a file you specify with -f, then call - them with an expression you specify with -e. -(If you mix -e and -f then the expressions are evaluated in the order encountered. -Since the expression pieces are simply concatenated, please be sure to use intervening -semicolons to separate expressions.) ---no-fflush: for emit, tee, print, and dump, don't call fflush() after every - record. -Any of the output-format command-line flags (see mlr -h). Example: using - mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ... -the input is CSV, the output is pretty-print tabular, but the tee-file output -is written in JSON format. - -Please use a dollar sign for field names and double-quotes for string -literals. If field names have special characters such as "." then you might -use braces, e.g. '${field.name}'. Miller built-in variables are -NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment -variables. The environment-variable name may be an expression, e.g. a field -value. - -Use # to comment to end of line. .fi .if n \{\ .RE diff --git a/doc/reference.html b/doc/reference.html index 79c465a60..adbe7b040 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -1248,10 +1248,11 @@ If there are multiple semicolon-delimited expressions, all of them are evaluated and the last one is used as the filter criterion. Options: --v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. --t: Print low-level parser-trace to stderr. +-v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. +-a: Prints a low-level stack-allocation trace to stdout. +-t: Prints a low-level parser trace to stderr. -x: Prints records for which {expression} evaluates to false. -S: Keeps field values, or literals in the expression, as strings with no type inference to int or float. @@ -2219,10 +2220,11 @@ booleans without following curly braces do nothing except side effects (e.g. regex-captures into \1, \2, etc.). Options: --v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. --t: Print low-level parser-trace to stderr. +-v: Prints the expressions's AST (abstract syntax tree), which gives + full transparency on the precedence and associativity rules of + Miller's grammar, to stdout. +-a: Prints a low-level stack-allocation trace to stdout. +-t: Prints a low-level parser trace to stderr. -q: Does not include the modified record in the output stream. Useful for when all desired output is in begin and/or end blocks. -S: Keeps field values, or literals in the expression, as strings with no type @@ -2285,45 +2287,6 @@ Please see http://johnkerl.org/miller/doc/reference.html for more information including function list. Or "mlr -f". Please see in particular: http://www.johnkerl.org/miller/doc/reference.html#put -Options: --v: First prints the AST (abstract syntax tree) for the expression, which gives - full transparency on the precedence and associativity rules of Miller's - grammar. --t: Print low-level parser-trace to stderr. --q: Does not include the modified record in the output stream. Useful for when - all desired output is in begin and/or end blocks. --S: Keeps field values, or literals in the expression, as strings with no type - inference to int or float. --F: Keeps field values, or literals in the expression, as strings or floats - with no inference to int. ---oflatsep {string}: Separator to use when flattening multi-level @-variables - to output records for emit. Default ":". --f {filename}: the DSL expression is taken from the specified file rather - than from the command line. Outer single quotes wrapping the expression - should not be placed in the file. If -f is specified more than once, - all input files specified using -f are concatenated to produce the expression. - (For example, you can define functions in one file and call them from another.) --e {expression}: You can use this after -f to add an expression. Example use - case: define functions/subroutines in a file you specify with -f, then call - them with an expression you specify with -e. -(If you mix -e and -f then the expressions are evaluated in the order encountered. -Since the expression pieces are simply concatenated, please be sure to use intervening -semicolons to separate expressions.) ---no-fflush: for emit, tee, print, and dump, don't call fflush() after every - record. -Any of the output-format command-line flags (see mlr -h). Example: using - mlr --icsv --opprint ... then put --ojson 'tee > "mytap-".$a.".dat", $*' then ... -the input is CSV, the output is pretty-print tabular, but the tee-file output -is written in JSON format. - -Please use a dollar sign for field names and double-quotes for string -literals. If field names have special characters such as "." then you might -use braces, e.g. '${field.name}'. Miller built-in variables are -NF NR FNR FILENUM FILENAME PI E, and ENV["namegoeshere"] to access environment -variables. The environment-variable name may be an expression, e.g. a field -value. - -Use # to comment to end of line.