zed icon indicating copy to clipboard operation
zed copied to clipboard

ZSON reader ignores incomplete trailing type value or decorator

Open nwt opened this issue 4 years ago • 1 comments

As of 87686d6e6ed829bea2bf339e2dc64b339461718f, reading ZSON that ends with an incomplete type value or decorator succeeds with no output. Both should fail with an error message.

$ echo '(' | zq -i zson -
$ echo $?
0

$ echo '1 (' | zq -i zson -
$ echo $?
0

nwt avatar Dec 15 '21 15:12 nwt

I've confirmed this one has not yet been fixed.

The first example as written has been producing an error ever since Zed commit 327270e that was associated with #3459, while there's no change in the second example. Using current tip of main commit 26dbda0:

$ echo '(' | zq -i zson -
stdio:stdin: ZSON syntax error

$ echo '1 (' | zq -i zson -
$ echo $?
0

However, with a closer look at #3459, we see that we've changed the syntax for specifying type values from parens to angle brackets. Therefore the first example now becomes:

$ echo '<' | zq -i zson -
$ echo $?
0

Therefore the problem is still very much with us.

philrz avatar Jul 27 '22 23:07 philrz