jaq icon indicating copy to clipboard operation
jaq copied to clipboard

interpolation

Open pkoppstein opened this issue 1 year ago • 1 comments

The README mentions that string interpolation is supported, so it looks like the following example reveals a bug:

$ jq -n '"\(select(1) | null) xyzzy"'
"null xyzzy"

$ jaq -n '"\(select(1) | null) xyzzy"'
Error: Unexpected token while parsing string, expected b, r, ", n, t, \, f, /, u
   ╭─[<unknown>:1:3]
   │
 1 │ "\(select(1) | null) xyzzy"
   ·   ┬  
   ·   ╰── Unexpected token (
───╯
Error: Unexpected end of input while parsing string, expected ", \
   ╭─[<unknown>:1:28]
   │
 1 │ "\(select(1) | null) xyzzy"
   ·                            │ 
   ·                            ╰─ Unexpected end of input
───╯

pkoppstein avatar Sep 02 '22 21:09 pkoppstein

Oh dear! This is a misunderstanding; the README mentions string interpolation indeed, but the checkbox is not ticked to indicate that this is not implemented yet:

  • [x] Identity (.)
  • [x] Recursion (..)
  • ...
  • [ ] String interpolation

☝️

How can I make this clearer?

(And if you would like to see string interpolation in jaq, I would be very happy about a PR for it. ^^ It's probably not trivial, though.)

01mf02 avatar Sep 15 '22 13:09 01mf02

How can I make this clearer?

How about something like:

Here is an overview that summarizes:

☑ features that have been implemented ☐ features that remain to be implemented

pkoppstein avatar Sep 28 '22 04:09 pkoppstein

That is a great idea. I implemented it in 1ef1994. Thanks!

01mf02 avatar Sep 29 '22 14:09 01mf02