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

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

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;

review: Needs Fixing

« Back to merge proposal