Code review comment for lp:~zorba-coders/zorba/new-jsoniq

Revision history for this message
Nicolae Brinza (nbrinza) wrote :

Matthias, your suggestions for two improved warnings do not change the messages: you just switched the order of the words. The warnings are built around the template:

    feature not supported by the common language grammar{: $1}

So it is not easy to make this swap. I could probably do it, but then I would have to change all the other messages. Do you think it is worth it?

Other than that, I have fixed all of the issues raised by you and Ghislain.

There has been a confusion which resulted in many warnings not working for you and Ghislain even though they were implemented. The problem was that you both used a qualified string for the "op:enable" option, i.e. you used "f:common-language". Why would you need a qualified value if the option itself is already qualified?

As we discussed, it is not possible to resolve a prefix during the Bison parsing, and that is why the initial code did not allow for a prefix in the value. I have changed it, and now it allows a prefix but it will be ignored during the parsing.

--

> 1. improve warning messages:
>
> feature not supported by the common language grammar: JSONiq dot object lookup
> =>
> jsoniq dot object lookup not supported by common language
>
>
> feature not supported by the common language grammar: context item expression;
> use zorba-util:context-item()
> =>
> context item expression not supported by common language (use util:context-
> item() instead)
>
> 2. Query doesn't raise a warning:
> jsoniq version "1.0";
>
> declare namespace op = "http://www.zorba-xquery.com/options/features";
> declare namespace f = "http://www.zorba-xquery.com/features";
>
> declare option op:enable "f:common-language";
>
> {}
>
> 3. Query without version declaration doesn't raise a warning
>
> 4. Query returns warning with wrong warning location, i.e. 8,13
>
> jsoniq version "1.0";
>
> declare namespace op = "http://www.zorba-xquery.com/options/features";
> declare namespace f = "http://www.zorba-xquery.com/features";
>
> declare option op:enable "f:common-language";
>
> let $foo := { "f.oo" : "bar" }.f.oo
> return $foo
>
> </home/mbrantner/zorba/build/tmp.xq>:8,13: Zorba static warning
> [zwarn:ZWST0009]: feature not supported by the common language grammar: JSONiq
> dot object lookup
> </home/mbrantner/zorba/build/tmp.xq>:8,13: Zorba static warning
> [zwarn:ZWST0009]: feature not supported by the common language grammar: JSONiq
> dot object lookup
>
> 5. The following query doesn't raise a warning
>
> xquery version "1.0";
>
> declare namespace op = "http://www.zorba-xquery.com/options/features";
> declare namespace f = "http://www.zorba-xquery.com/features";
>
> declare option op:enable "f:common-language";
>
> let $foo := 'foo'
> return $foo
>
> 6. The following query doesn't raise a warning
>
> jsoniq version "1.0";
>
> declare namespace op = "http://www.zorba-xquery.com/options/features";
> declare namespace f = "http://www.zorba-xquery.com/features";
>
> declare option op:enable "f:common-language";
>
> let $foo := { foo : "bar" }
> return insert { "bar" : 42 } into $foo;

« Back to merge proposal