Merge lp:~zorba-coders/zorba/fix_bug_987830 into lp:zorba

Proposed by Sorin Marian Nasoi
Status: Merged
Approved by: Sorin Marian Nasoi
Approved revision: 10799
Merged at revision: 10809
Proposed branch: lp:~zorba-coders/zorba/fix_bug_987830
Merge into: lp:zorba
Diff against target: 138 lines (+22/-11)
7 files modified
modules/ExternalModules.conf (+2/-2)
modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq (+1/-1)
modules/com/zorba-xquery/www/modules/project_xqdoc.xq (+2/-2)
modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq (+2/-2)
modules/org/expath/ns/file.xq (+1/-1)
src/compiler/translator/translator.cpp (+1/-1)
test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq (+13/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/fix_bug_987830
Reviewer Review Type Date Requested Status
Sorin Marian Nasoi Approve
Markos Zaharioudakis Approve
Review via email: mp+103370@code.launchpad.net

Commit message

fix for lp:987830.

Description of the change

fix for lp:987830.

To post a comment you must log in.
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

"empty" and "none" are not valid sequence types. We should try that are modules are at least parsable by other engines as well, so we should use valid sequence types.; For "empty" use empty-sequence(). There is not a valid sequence type for "none", but I did not see it used anywhere. Do you plan to use it? where?

This also means that the code in translator.cpp should be removed.

review: Needs Fixing
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

> "empty" and "none" are not valid sequence types. We should try that are
> modules are at least parsable by other engines as well, so we should use valid
> sequence types.; For "empty" use empty-sequence().
http://www.w3.org/TR/xquery-semantics/#sec_content_models
From this I understand that:
- The type empty matches the empty sequence.
- The type none matches no values.

>There is not a valid sequence type for "none", but I did not see it used anywhere. Do you plan to
> use it? where?
The type none is the static type for [7.2.9 The fn:error function].

> This also means that the code in translator.cpp should be removed.
So where should
http://www.w3.org/TR/xquery-semantics/#sec_content_models
be implemented then?

Thanks for the help.

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

The module files should contain syntactically valid XQuery code. The formal semantics spec you cite is not concerned with syntax, and not everything described there has a coresponding syntactic construct. The none type is one example from the formal semantics that cannot be expressed syntactically. To see what types can be expressed syntactically, you have to look here:

http://www.w3.org/TR/xquery-30/#id-sequencetype-syntax

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

> The module files should contain syntactically valid XQuery code. The formal
> semantics spec you cite is not concerned with syntax, and not everything
> described there has a coresponding syntactic construct. The none type is one
> example from the formal semantics that cannot be expressed syntactically. To
> see what types can be expressed syntactically, you have to look here:
>
> http://www.w3.org/TR/xquery-30/#id-sequencetype-syntax
I see this makes sense.

One more thing though: where is the exception added for the fn:error function:
http://www.w3.org/TR/xpath-functions-30/#func-error ?

Thanks,
Sorin

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/fix_bug_987830 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job fix_bug_987830-2012-05-01T11-24-01.368Z is finished.
  The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

10798. By Sorin Marian Nasoi <email address hidden>

Merged trunk.

10799. By Sorin Marian Nasoi <email address hidden>

Updated the version fo the Oauth adn data-cleaning modules.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job fix_bug_987830-2012-05-01T21-57-59.05Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/ExternalModules.conf'
--- modules/ExternalModules.conf 2012-04-26 20:54:34 +0000
+++ modules/ExternalModules.conf 2012-05-01 21:52:19 +0000
@@ -26,7 +26,7 @@
26# "tag" is the VCS tag to check out (optional - defaults to HEAD;26# "tag" is the VCS tag to check out (optional - defaults to HEAD;
27# currently only works for bzr, since svn tags are just different URLS)27# currently only works for bzr, since svn tags are just different URLS)
2828
29data-cleaning bzr lp:zorba/data-cleaning-module zorba-2.2 29data-cleaning bzr lp:zorba/data-cleaning-module 1.1
30data-converters bzr lp:zorba/data-converters-module zorba-2.2 30data-converters bzr lp:zorba/data-converters-module zorba-2.2
31data-formatting bzr lp:zorba/data-formatting-module zorba-2.2-jvm31data-formatting bzr lp:zorba/data-formatting-module zorba-2.2-jvm
32excel bzr lp:zorba/excel-module zorba-2.2 32excel bzr lp:zorba/excel-module zorba-2.2
@@ -34,7 +34,7 @@
34http-client bzr lp:zorba/http-client-module zorba-2.2 34http-client bzr lp:zorba/http-client-module zorba-2.2
35image bzr lp:zorba/image-module 1.035image bzr lp:zorba/image-module 1.0
36languages bzr lp:zorba/languages-module zorba-2.2 36languages bzr lp:zorba/languages-module zorba-2.2
37oauth bzr lp:zorba/oauth-module zorba-2.2 37oauth bzr lp:zorba/oauth-module 1.0
38process bzr lp:zorba/process-module zorba-2.2 38process bzr lp:zorba/process-module zorba-2.2
39security bzr lp:zorba/security-module zorba-2.2 39security bzr lp:zorba/security-module zorba-2.2
40system bzr lp:zorba/system-module zorba-2.2 40system bzr lp:zorba/system-module zorba-2.2
4141
=== modified file 'modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq'
--- modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq 2012-04-24 12:39:38 +0000
+++ modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq 2012-05-01 21:52:19 +0000
@@ -258,7 +258,7 @@
258 : @param $message the message.258 : @param $message the message.
259 : @return ().259 : @return ().
260 :)260 :)
261declare function dmh:process($message as element())261declare function dmh:process($message as element()) as xs:anyAtomicType*
262{262{
263 let $nodeName := fn:local-name($message)263 let $nodeName := fn:local-name($message)
264 let $id := fn:data($message/@transaction_id)264 let $id := fn:data($message/@transaction_id)
265265
=== modified file 'modules/com/zorba-xquery/www/modules/project_xqdoc.xq'
--- modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-04-24 22:08:01 +0000
+++ modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-05-01 21:52:19 +0000
@@ -59,7 +59,7 @@
59 : @return empty sequence.59 : @return empty sequence.
60 :)60 :)
61declare %an:sequential function pxqdoc:delete-XML-dir(61declare %an:sequential function pxqdoc:delete-XML-dir(
62 $xqdocPath as xs:string)62 $xqdocPath as xs:string) as empty-sequence()
63{63{
64 variable $xqdocXMLPath := fn:concat( $xqdocPath,64 variable $xqdocXMLPath := fn:concat( $xqdocPath,
65 file:directory-separator(),65 file:directory-separator(),
@@ -92,7 +92,7 @@
92 :)92 :)
93declare %an:sequential function pxqdoc:generate-xqdoc-XML(93declare %an:sequential function pxqdoc:generate-xqdoc-XML(
94 $zorbaManifestPath as xs:string,94 $zorbaManifestPath as xs:string,
95 $xqdocPath as xs:string)95 $xqdocPath as xs:string) as empty-sequence()
96{96{
97 (: Note: only the modules that are configured in the Zorba version you are using will be build :) 97 (: Note: only the modules that are configured in the Zorba version you are using will be build :)
98 variable $xqdocXMLPath := concat($xqdocPath, file:directory-separator(), "xml");98 variable $xqdocXMLPath := concat($xqdocPath, file:directory-separator(), "xml");
9999
=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq'
--- modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-04-24 18:22:23 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-05-01 21:52:19 +0000
@@ -268,7 +268,7 @@
268 :)268 :)
269declare %an:sequential function xqdoc2html:copy-xhtml-requisites(269declare %an:sequential function xqdoc2html:copy-xhtml-requisites(
270 $xhtmlRequisitesPath as xs:string,270 $xhtmlRequisitesPath as xs:string,
271 $xqdocBuildPath as xs:string)271 $xqdocBuildPath as xs:string) as empty-sequence()
272{272{
273 let $xhtmlPath := fn:concat($xqdocBuildPath, file:directory-separator(), "xhtml"),273 let $xhtmlPath := fn:concat($xqdocBuildPath, file:directory-separator(), "xhtml"),
274 $xmlPath := fn:concat($xqdocBuildPath, file:directory-separator(), "xml"),274 $xmlPath := fn:concat($xqdocBuildPath, file:directory-separator(), "xml"),
@@ -370,7 +370,7 @@
370 $xqdocBuildPath as xs:string,370 $xqdocBuildPath as xs:string,
371 $indexHtmlPath as xs:string,371 $indexHtmlPath as xs:string,
372 $zorbaVersion as xs:string,372 $zorbaVersion as xs:string,
373 $xhtmlRequisitesPath as xs:string)373 $xhtmlRequisitesPath as xs:string) as empty-sequence()
374{374{
375 (: fill out $xqdoc2html:ZorbaManifest :)375 (: fill out $xqdoc2html:ZorbaManifest :)
376 xqdoc2html:collectZorbaManifestEntries($zorbaManifestPath, $xqdocBuildPath);376 xqdoc2html:collectZorbaManifestEntries($zorbaManifestPath, $xqdocBuildPath);
377377
=== modified file 'modules/org/expath/ns/file.xq'
--- modules/org/expath/ns/file.xq 2012-04-24 12:39:38 +0000
+++ modules/org/expath/ns/file.xq 2012-05-01 21:52:19 +0000
@@ -619,7 +619,7 @@
619 :)619 :)
620declare function file:glob-to-regex(620declare function file:glob-to-regex(
621 $pattern as xs:string621 $pattern as xs:string
622) {622) as xs:string {
623 let $pattern := fn:replace($pattern, '(\.|\[|\]|\\|/|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1')623 let $pattern := fn:replace($pattern, '(\.|\[|\]|\\|/|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1')
624 let $pattern := fn:replace($pattern, '\\\?', '.')624 let $pattern := fn:replace($pattern, '\\\?', '.')
625 let $pattern := fn:replace($pattern, '\\\*', '.*')625 let $pattern := fn:replace($pattern, '\\\*', '.*')
626626
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2012-05-01 15:54:27 +0000
+++ src/compiler/translator/translator.cpp 2012-05-01 21:52:19 +0000
@@ -11783,7 +11783,7 @@
11783 store::Item_t qnameItem;11783 store::Item_t qnameItem;
11784 expand_elem_qname(qnameItem, qname, loc);11784 expand_elem_qname(qnameItem, qname, loc);
1178511785
11786 xqtref_t t = CTX_TM->create_named_atomic_type(qnameItem, TypeConstants::QUANT_ONE);11786 xqtref_t t = CTX_TM->create_named_atomic_type(qnameItem, TypeConstants::QUANT_ONE);
1178711787
11788 // some types that should never be parsed, like xs:untyped, are;11788 // some types that should never be parsed, like xs:untyped, are;
11789 // we catch them with is_simple()11789 // we catch them with is_simple()
1179011790
=== modified file 'test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq'
--- test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2012-04-24 12:39:38 +0000
+++ test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2012-05-01 21:52:19 +0000
@@ -138,7 +138,9 @@
138 let $docParamCount := count($params)138 let $docParamCount := count($params)
139 let $missing := $paramCount - $docParamCount 139 let $missing := $paramCount - $docParamCount
140 let $hasDescr := exists($function/xqdoc:comment/xqdoc:description)140 let $hasDescr := exists($function/xqdoc:comment/xqdoc:description)
141 let $hasReturn := exists($function/xqdoc:comment/xqdoc:return)141 let $hasReturn := exists($function/xqdoc:return)
142 let $isUpdating := contains($signature, "updating")
143 let $isReturnDocumented := exists($function/xqdoc:comment/xqdoc:return)
142 return string-join((144 return string-join((
143 (: Test for function description :)145 (: Test for function description :)
144 if (not($hasDescr)) then146 if (not($hasDescr)) then
@@ -158,8 +160,17 @@
158 Arity: ", $paramCount)160 Arity: ", $paramCount)
159 else161 else
160 (),162 (),
163 (: Test for existing return value in function signature:)
164 if (not($hasReturn) and not($isUpdating)) then
165 concat("
166 ERROR: Return value for the function not stated explicitly in the function signature;
167 Module: ", $module/xqdoc:uri, "
168 Function: ", $function/xqdoc:name, "
169 Arity: ", $paramCount)
170 else
171 (),
161 (: Test for documented return value :)172 (: Test for documented return value :)
162 if (not($hasReturn)) then173 if (not($isReturnDocumented)) then
163 concat("174 concat("
164 ERROR: Return value not documented;175 ERROR: Return value not documented;
165 Module: ", $module/xqdoc:uri, "176 Module: ", $module/xqdoc:uri, "

Subscribers

People subscribed via source and target branches