From 2fd725209e33558c3a79b7316bf994dc55d3a005 Mon Sep 17 00:00:00 2001 From: Muh Muhten Date: Tue, 5 Feb 2019 23:52:50 -0500 Subject: Export input/0 directly from C, removing _input/0 The distinction between input/0 and _input/0 has been unnecessary since a9c613..7dc34b, which moved end-of-input handling into C and replaced the jq definition of input with `def input: _input;` --- src/builtin.c | 2 +- src/builtin.jq | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/builtin.c b/src/builtin.c index 95c2f4f2..87941984 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -1663,7 +1663,7 @@ static const struct cfunction function_list[] = { {(cfunction_ptr)f_get_jq_origin, "get_jq_origin", 1}, {(cfunction_ptr)f_match, "_match_impl", 4}, {(cfunction_ptr)f_modulemeta, "modulemeta", 1}, - {(cfunction_ptr)f_input, "_input", 1}, + {(cfunction_ptr)f_input, "input", 1}, {(cfunction_ptr)f_debug, "debug", 1}, {(cfunction_ptr)f_stderr, "stderr", 1}, {(cfunction_ptr)f_strptime, "strptime", 2}, diff --git a/src/builtin.jq b/src/builtin.jq index 92209237..02bec9c1 100644 --- a/src/builtin.jq +++ b/src/builtin.jq @@ -200,12 +200,11 @@ def transpose: end; def in(xs): . as $x | xs | has($x); def inside(xs): . as $x | xs | contains($x); -def input: _input; def repeat(exp): def _repeat: exp, _repeat; _repeat; -def inputs: try repeat(_input) catch if .=="break" then empty else .|error end; +def inputs: try repeat(input) catch if .=="break" then empty else .|error end; # like ruby's downcase - only characters A to Z are affected def ascii_downcase: explode | map( if 65 <= . and . <= 90 then . + 32 else . end) | implode; -- cgit v1.2.3