Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11043
Merged at revision: 11296
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 128 lines (+42/-23)
4 files modified
ChangeLog (+1/-0)
src/compiler/translator/translator.cpp (+39/-21)
src/store/naive/store.cpp (+1/-1)
src/types/root_typemanager.cpp (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+154479@code.launchpad.net

Commit message

in jsoniq mode, using null and atomic as type names (without prefix)

Description of the change

in jsoniq mode, using null and atomic as type names (without prefix)

To post a comment you must log in.
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 :

Validation queue job markos-scratch-2013-03-20T18-48-50.102Z 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 'ChangeLog'
2--- ChangeLog 2013-03-18 21:35:13 +0000
3+++ ChangeLog 2013-03-20 18:44:21 +0000
4@@ -24,6 +24,7 @@
5 * Extended optimization rules for subsequence function (pushing $startingLoc
6 parameter into collection skip if $sourceSeq parameter is from a
7 collection).
8+ * Optimized fn:index-of function
9 * Extented index join rule to general flwor expressions.
10
11 Bug Fixes/Other Changes:
12
13=== modified file 'src/compiler/translator/translator.cpp'
14--- src/compiler/translator/translator.cpp 2013-03-20 01:19:04 +0000
15+++ src/compiler/translator/translator.cpp 2013-03-20 18:44:21 +0000
16@@ -1053,6 +1053,42 @@
17
18
19 /*******************************************************************************
20+
21+********************************************************************************/
22+void expand_type_qname(
23+ store::Item_t& qnameItem,
24+ const QName* qname,
25+ const QueryLoc& loc) const
26+{
27+ if (!qname->get_prefix().empty() || !theCCB->theConfig.jsoniq_mode)
28+ {
29+ expand_elem_qname(qnameItem, qname, loc);
30+ }
31+ else
32+ {
33+ zstring local = qname->get_localname();
34+ zstring ns;
35+
36+ if (local == "null")
37+ {
38+ ns = static_context::JSONIQ_DM_NS;
39+ }
40+ else if (local == "atomic")
41+ {
42+ ns = XML_SCHEMA_NS;
43+ local = "anyAtomicType";
44+ }
45+ else
46+ {
47+ ns = XML_SCHEMA_NS;
48+ }
49+
50+ GENV_ITEMFACTORY->createQName(qnameItem, ns, "", local);
51+ }
52+}
53+
54+
55+/*******************************************************************************
56 Convert a lexical qname representing an element tag name or a type name to an
57 expanded qname item. If the lexical qname does not have a prefix, the default
58 element namespace (if any) will be used to build the expanded qname item.
59@@ -8648,16 +8684,7 @@
60
61 rchandle<QName> qname = v.get_qname();
62 store::Item_t qnameItem;
63-
64- if (!qname->get_prefix().empty() || !theCCB->theConfig.jsoniq_mode)
65- {
66- expand_elem_qname(qnameItem, qname, loc);
67- }
68- else
69- {
70- GENV_ITEMFACTORY->
71- createQName(qnameItem, XML_SCHEMA_NS, "", qname->get_localname());
72- }
73+ expand_type_qname(qnameItem, qname, loc);
74
75 xqtref_t t = CTX_TM->create_named_simple_type(qnameItem);
76
77@@ -10793,7 +10820,7 @@
78 else
79 {
80 // Check if this is a call to a type constructor function
81- expand_function_qname(qnameItem, qname, loc);
82+ expand_type_qname(qnameItem, qname, loc);
83
84 xqtref_t type = CTX_TM->create_named_type(qnameItem,
85 TypeConstants::QUANT_QUESTION,
86@@ -13103,16 +13130,7 @@
87
88 rchandle<QName> qname = v.get_qname();
89 store::Item_t qnameItem;
90-
91- if (!qname->get_prefix().empty() || !theCCB->theConfig.jsoniq_mode)
92- {
93- expand_elem_qname(qnameItem, qname, loc);
94- }
95- else
96- {
97- GENV_ITEMFACTORY->
98- createQName(qnameItem, XML_SCHEMA_NS, "", qname->get_localname());
99- }
100+ expand_type_qname(qnameItem, qname, loc);
101
102 xqtref_t t = CTX_TM->create_named_simple_type(qnameItem);
103
104
105=== modified file 'src/store/naive/store.cpp'
106--- src/store/naive/store.cpp 2013-03-12 17:03:31 +0000
107+++ src/store/naive/store.cpp 2013-03-20 18:44:21 +0000
108@@ -250,7 +250,7 @@
109 theSchemaTypeNames[store::XS_HEXBINARY] = theQNamePool->insert(ns, "xs", "hexBinary");
110 theSchemaTypeNames[store::XS_BOOLEAN] = theQNamePool->insert(ns, "xs", "boolean");
111
112- for (ulong i = 0; i < store::XS_LAST; ++i)
113+ for (csize i = 0; i < store::XS_LAST; ++i)
114 {
115 theSchemaTypeCodes[theSchemaTypeNames[i].getp()] =
116 static_cast<store::SchemaTypeCode>(i);
117
118=== modified file 'src/types/root_typemanager.cpp'
119--- src/types/root_typemanager.cpp 2013-03-18 17:59:14 +0000
120+++ src/types/root_typemanager.cpp 2013-03-20 18:44:21 +0000
121@@ -291,7 +291,7 @@
122 #ifdef ZORBA_WITH_JSON
123 GENV_STORE.getItemFactory()->createQName(JS_NULL_QNAME,
124 static_context::JSONIQ_DM_NS,
125- "jn",
126+ "js",
127 "null");
128 #endif
129

Subscribers

People subscribed via source and target branches