Skip to content

Commit

Permalink
More jaq null index comments cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Nov 26, 2024
1 parent f54625e commit b3c6edc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions jqjq.jq
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,6 @@ def parse:
, queries:
[ {term: {str: $string_start, type: "TermTypeString"}}
, ( $queries[]
# TODO: jaq: null index
| if .term and .term.type == "TermTypeString" then .
else {term: {query: ., type: "TermTypeQuery"}}
end
Expand Down Expand Up @@ -1474,7 +1473,6 @@ def eval_ast($query; $path; $env; undefined_func):
$query.term.index;
$path;
.;
# TODO: jaq: make ast more explicit?
( $query.term.suffix_list
| if . != null then .[0].optional
else false
Expand Down Expand Up @@ -1517,7 +1515,7 @@ def eval_ast($query; $path; $env; undefined_func):
| $query.term.func as {$name, $args}
| func_name($name; $args) as $name
| $query_env[$name] as $e
# TODO: jaq null index and null has()
# jaq: null | has() is an error
| if $e != null and ($e | has("value")) then [[null], $e.value]
elif $e != null and $e.body then
( ($e.args // []) as $func_args
Expand Down Expand Up @@ -1726,7 +1724,7 @@ def eval_ast($query; $path; $env; undefined_func):
| if startswith("$") then .[1:] else . end
| _term_str
)
, ( # TOOD: jaq: null index
, ( # TODO: jaq: null index
( $kv.val
| values
| .queries[0]
Expand Down

0 comments on commit b3c6edc

Please sign in to comment.