Skip to content
Myr

Export input/0 directly from C, removing _input/0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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;`

authored by Muh Muhten · committed by Nico Williams · parent 21be385 · Browse files · 2 files+2 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−3 removed

  • other:+2 added−3 removed

2 files+2 added−3 removed

modified:src/builtin.c+1 added-1 removed
1661 unmodified lines
1662 {(cfunction_ptr)f_get_prog_origin, "get_prog_origin", 1},1663 {(cfunction_ptr)f_get_jq_origin, "get_jq_origin", 1},1664 {(cfunction_ptr)f_match, "_match_impl", 4},1665 {(cfunction_ptr)f_modulemeta, "modulemeta", 1},1666 {(cfunction_ptr)f_input, "_input", 1},1666 {(cfunction_ptr)f_input, "input", 1},1667 {(cfunction_ptr)f_debug, "debug", 1},1668 {(cfunction_ptr)f_stderr, "stderr", 1},1669 {(cfunction_ptr)f_strptime, "strptime", 2},1670 {(cfunction_ptr)f_strftime, "strftime", 2},
142 unmodified lines
modified:src/builtin.jq+1 added-2 removed
198 unmodified lines
199 ([]; . + [reduce range(0;$length) as $i ([]; . + [ $in[$i][$j] ] )] )200 end;201def in(xs): . as $x | xs | has($x);202def inside(xs): . as $x | xs | contains($x);203def input: _input;203def repeat(exp):204 def _repeat:205 exp, _repeat;206 _repeat;208def inputs: try repeat(_input) catch if .=="break" then empty else .|error end;207def inputs: try repeat(input) catch if .=="break" then empty else .|error end;208# like ruby's downcase - only characters A to Z are affected209def ascii_downcase:210 explode | map( if 65 <= . and . <= 90 then . + 32 else . end) | implode;211# like ruby's upcase - only characters a to z are affected
102 unmodified lines