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
1=== modified file 'modules/ExternalModules.conf'
2--- modules/ExternalModules.conf 2012-04-26 20:54:34 +0000
3+++ modules/ExternalModules.conf 2012-05-01 21:52:19 +0000
4@@ -26,7 +26,7 @@
5 # "tag" is the VCS tag to check out (optional - defaults to HEAD;
6 # currently only works for bzr, since svn tags are just different URLS)
7
8-data-cleaning bzr lp:zorba/data-cleaning-module zorba-2.2
9+data-cleaning bzr lp:zorba/data-cleaning-module 1.1
10 data-converters bzr lp:zorba/data-converters-module zorba-2.2
11 data-formatting bzr lp:zorba/data-formatting-module zorba-2.2-jvm
12 excel bzr lp:zorba/excel-module zorba-2.2
13@@ -34,7 +34,7 @@
14 http-client bzr lp:zorba/http-client-module zorba-2.2
15 image bzr lp:zorba/image-module 1.0
16 languages bzr lp:zorba/languages-module zorba-2.2
17-oauth bzr lp:zorba/oauth-module zorba-2.2
18+oauth bzr lp:zorba/oauth-module 1.0
19 process bzr lp:zorba/process-module zorba-2.2
20 security bzr lp:zorba/security-module zorba-2.2
21 system bzr lp:zorba/system-module zorba-2.2
22
23=== modified file 'modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq'
24--- modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq 2012-04-24 12:39:38 +0000
25+++ modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq 2012-05-01 21:52:19 +0000
26@@ -258,7 +258,7 @@
27 : @param $message the message.
28 : @return ().
29 :)
30-declare function dmh:process($message as element())
31+declare function dmh:process($message as element()) as xs:anyAtomicType*
32 {
33 let $nodeName := fn:local-name($message)
34 let $id := fn:data($message/@transaction_id)
35
36=== modified file 'modules/com/zorba-xquery/www/modules/project_xqdoc.xq'
37--- modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-04-24 22:08:01 +0000
38+++ modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-05-01 21:52:19 +0000
39@@ -59,7 +59,7 @@
40 : @return empty sequence.
41 :)
42 declare %an:sequential function pxqdoc:delete-XML-dir(
43- $xqdocPath as xs:string)
44+ $xqdocPath as xs:string) as empty-sequence()
45 {
46 variable $xqdocXMLPath := fn:concat( $xqdocPath,
47 file:directory-separator(),
48@@ -92,7 +92,7 @@
49 :)
50 declare %an:sequential function pxqdoc:generate-xqdoc-XML(
51 $zorbaManifestPath as xs:string,
52- $xqdocPath as xs:string)
53+ $xqdocPath as xs:string) as empty-sequence()
54 {
55 (: Note: only the modules that are configured in the Zorba version you are using will be build :)
56 variable $xqdocXMLPath := concat($xqdocPath, file:directory-separator(), "xml");
57
58=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq'
59--- modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-04-24 18:22:23 +0000
60+++ modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-05-01 21:52:19 +0000
61@@ -268,7 +268,7 @@
62 :)
63 declare %an:sequential function xqdoc2html:copy-xhtml-requisites(
64 $xhtmlRequisitesPath as xs:string,
65- $xqdocBuildPath as xs:string)
66+ $xqdocBuildPath as xs:string) as empty-sequence()
67 {
68 let $xhtmlPath := fn:concat($xqdocBuildPath, file:directory-separator(), "xhtml"),
69 $xmlPath := fn:concat($xqdocBuildPath, file:directory-separator(), "xml"),
70@@ -370,7 +370,7 @@
71 $xqdocBuildPath as xs:string,
72 $indexHtmlPath as xs:string,
73 $zorbaVersion as xs:string,
74- $xhtmlRequisitesPath as xs:string)
75+ $xhtmlRequisitesPath as xs:string) as empty-sequence()
76 {
77 (: fill out $xqdoc2html:ZorbaManifest :)
78 xqdoc2html:collectZorbaManifestEntries($zorbaManifestPath, $xqdocBuildPath);
79
80=== modified file 'modules/org/expath/ns/file.xq'
81--- modules/org/expath/ns/file.xq 2012-04-24 12:39:38 +0000
82+++ modules/org/expath/ns/file.xq 2012-05-01 21:52:19 +0000
83@@ -619,7 +619,7 @@
84 :)
85 declare function file:glob-to-regex(
86 $pattern as xs:string
87-) {
88+) as xs:string {
89 let $pattern := fn:replace($pattern, '(\.|\[|\]|\\|/|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1')
90 let $pattern := fn:replace($pattern, '\\\?', '.')
91 let $pattern := fn:replace($pattern, '\\\*', '.*')
92
93=== modified file 'src/compiler/translator/translator.cpp'
94--- src/compiler/translator/translator.cpp 2012-05-01 15:54:27 +0000
95+++ src/compiler/translator/translator.cpp 2012-05-01 21:52:19 +0000
96@@ -11783,7 +11783,7 @@
97 store::Item_t qnameItem;
98 expand_elem_qname(qnameItem, qname, loc);
99
100- xqtref_t t = CTX_TM->create_named_atomic_type(qnameItem, TypeConstants::QUANT_ONE);
101+ xqtref_t t = CTX_TM->create_named_atomic_type(qnameItem, TypeConstants::QUANT_ONE);
102
103 // some types that should never be parsed, like xs:untyped, are;
104 // we catch them with is_simple()
105
106=== modified file 'test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq'
107--- test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2012-04-24 12:39:38 +0000
108+++ test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2012-05-01 21:52:19 +0000
109@@ -138,7 +138,9 @@
110 let $docParamCount := count($params)
111 let $missing := $paramCount - $docParamCount
112 let $hasDescr := exists($function/xqdoc:comment/xqdoc:description)
113- let $hasReturn := exists($function/xqdoc:comment/xqdoc:return)
114+ let $hasReturn := exists($function/xqdoc:return)
115+ let $isUpdating := contains($signature, "updating")
116+ let $isReturnDocumented := exists($function/xqdoc:comment/xqdoc:return)
117 return string-join((
118 (: Test for function description :)
119 if (not($hasDescr)) then
120@@ -158,8 +160,17 @@
121 Arity: ", $paramCount)
122 else
123 (),
124+ (: Test for existing return value in function signature:)
125+ if (not($hasReturn) and not($isUpdating)) then
126+ concat("
127+ ERROR: Return value for the function not stated explicitly in the function signature;
128+ Module: ", $module/xqdoc:uri, "
129+ Function: ", $function/xqdoc:name, "
130+ Arity: ", $paramCount)
131+ else
132+ (),
133 (: Test for documented return value :)
134- if (not($hasReturn)) then
135+ if (not($isReturnDocumented)) then
136 concat("
137 ERROR: Return value not documented;
138 Module: ", $module/xqdoc:uri, "

Subscribers

People subscribed via source and target branches