summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuh Muhten <muh.muhten@gmail.com>2019-02-05 23:52:50 -0500
committerNico Williams <nico@cryptonector.com>2019-02-06 12:06:03 -0600
commit2fd725209e33558c3a79b7316bf994dc55d3a005 (patch)
treeb3f65a75b126e76c3d045a968846285ff55f538d
parent21be3857b5317d03601487408b4b7eeec69f5bfc (diff)
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;`
-rw-r--r--src/builtin.c2
-rw-r--r--src/builtin.jq3
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;