zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #22921
[Merge] lp:~zorba-coders/zorba/markos-scratch into lp:zorba
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch into lp:zorba.
Commit message:
no math prefix required for jsoniq
Requested reviews:
Markos Zaharioudakis (markos-za)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/168277
no math prefix required for jsoniq
--
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/168277
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2013-06-08 05:33:57 +0000
+++ src/compiler/translator/translator.cpp 2013-06-09 08:16:26 +0000
@@ -3896,7 +3896,7 @@
ns == XML_NS ||
ns == XML_SCHEMA_NS ||
ns == XSI_NS ||
- ns == XQUERY_MATH_FN_NS)
+ ns == static_context::XQUERY_MATH_FN_NS)
{
RAISE_ERROR(err::XQST0045, func_decl->get_location(),
ERROR_PARAMS(qnameItem->getLocalName(), ZED(FUNCTION), ns));
@@ -4824,7 +4824,7 @@
annotNS == XML_SCHEMA_NS ||
annotNS == XSI_NS ||
annotNS == static_context::W3C_FN_NS ||
- annotNS == XQUERY_MATH_FN_NS ||
+ annotNS == static_context::XQUERY_MATH_FN_NS ||
annotNS == ZORBA_ANNOTATIONS_NS)
{
if (AnnotationInternal::lookup(expandedQName) == AnnotationInternal::zann_end)
@@ -11606,7 +11606,7 @@
if (f->isBuiltin() &&
fn_ns != static_context::W3C_FN_NS &&
fn_ns != static_context::JSONIQ_FN_NS &&
- fn_ns != XQUERY_MATH_FN_NS &&
+ fn_ns != static_context::XQUERY_MATH_FN_NS &&
fn_ns != theModuleNamespace)
{
if (! theSctx->is_imported_builtin_module(fn_ns))
@@ -12521,7 +12521,7 @@
if (f->isBuiltin() &&
fn_ns != static_context::W3C_FN_NS &&
fn_ns != static_context::JSONIQ_FN_NS &&
- fn_ns != XQUERY_MATH_FN_NS &&
+ fn_ns != static_context::XQUERY_MATH_FN_NS &&
fn_ns != theModuleNamespace)
{
if (! theSctx->is_imported_builtin_module(fn_ns))
=== modified file 'src/context/root_static_context.cpp'
--- src/context/root_static_context.cpp 2013-05-15 10:00:58 +0000
+++ src/context/root_static_context.cpp 2013-06-09 08:16:26 +0000
@@ -138,10 +138,8 @@
{
//"err", XQUERY_ERR_NS,
"fn", static_context::W3C_FN_NS,
-#ifdef ZORBA_WITH_JSON
"jn", static_context::JSONIQ_FN_NS,
"js", static_context::JSONIQ_DM_NS,
-#endif
"local", XQUERY_LOCAL_FN_NS,
"xml", XML_NS,
"xs", XML_SCHEMA_NS,
@@ -158,6 +156,7 @@
set_default_elem_type_ns(zstring(), true, loc);
+ set_default_function_ns(XQUERY_MATH_FN_NS, false, loc);
set_default_function_ns(JSONIQ_FN_NS, false, loc);
set_default_function_ns(W3C_FN_NS, false, loc);
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2013-04-23 13:12:58 +0000
+++ src/context/static_context.cpp 2013-06-09 08:16:26 +0000
@@ -340,6 +340,9 @@
static_context::W3C_XML_NS = "http://www.w3.org/XML/1998/namespace";;
const char*
+static_context::XQUERY_MATH_FN_NS = "http://www.w3.org/2005/xpath-functions/math";;
+
+const char*
static_context::ZORBA_MATH_FN_NS =
"http://www.zorba-xquery.com/modules/math";;
=== modified file 'src/context/static_context.h'
--- src/context/static_context.h 2013-04-27 03:30:17 +0000
+++ src/context/static_context.h 2013-06-09 08:16:26 +0000
@@ -503,6 +503,9 @@
static const char* W3C_ERR_NS; // http://www.w3.org/2005/xqt-errors
+ static const char* XQUERY_MATH_FN_NS; // http://www.w3.org/2005/xpath-functions/math
+ // not predeclared in XQuery 3.0
+
//
// Zorba namespaces
//
=== modified file 'src/zorbamisc/ns_consts.h'
--- src/zorbamisc/ns_consts.h 2013-02-07 17:24:36 +0000
+++ src/zorbamisc/ns_consts.h 2013-06-09 08:16:26 +0000
@@ -33,16 +33,13 @@
#define XML_SCHEMA_NS W3C_NS "2001/XMLSchema"
#define XML_SCHEMA_PREFIX "xs"
-#define XQUERY_ERR_NS W3C_NS "2005/xqt-errors" //not predeclared in XQuery 3.0
+#define XQUERY_ERR_NS W3C_NS "2005/xqt-errors" //not predeclared in XQuery 3.0
#define XQUERY_LOCAL_FN_NS W3C_NS "2005/xquery-local-functions"
#define XQUERY_XPATH_FN_NS W3C_NS "2005/xpath-functions"
-#define XQUERY_MATH_FN_NS W3C_NS "2005/xpath-functions/math" //not predeclared in XQuery 3.0
#define XSI_NS W3C_NS "2001/XMLSchema-instance"
-#ifdef ZORBA_WITH_JSON
#define JSONIQ_ERR_NS "http://jsoniq.org/errors";
-#endif
///////////////////////////////////////////////////////////////////////////////
=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/math_01.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/math_01.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/math_01.xml.res 2013-06-09 08:16:26 +0000
@@ -0,0 +1,1 @@
+{ "pi" : 3.1415926535897931 }
=== added file 'test/rbkt/Queries/zorba/jsoniq/math_01.jq'
--- test/rbkt/Queries/zorba/jsoniq/math_01.jq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/math_01.jq 2013-06-09 08:16:26 +0000
@@ -0,0 +1,2 @@
+
+{ "pi" : pi() }
Follow ups