← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/bug-analyze_string into lp:zorba

 

Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug-analyze_string into lp:zorba.

Requested reviews:
  Paul J. Lucas (paul-lucas)
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-analyze_string/+merge/97671

proper return type specification for analyze-string done manually instead of automatically done by the code generation.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-analyze_string/+merge/97671
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/functions/func_strings_impl.cpp'
--- src/functions/func_strings_impl.cpp	2012-01-11 17:30:25 +0000
+++ src/functions/func_strings_impl.cpp	2012-03-15 15:00:28 +0000
@@ -61,6 +61,44 @@
   return NULL;
 }
 
+
+/*******************************************************************************
+
+********************************************************************************/
+void populate_context_strings_impl(static_context* sctx)
+{
+  xqtref_t lAnalyzeStringResultType =
+    GENV_TYPESYSTEM.create_node_type(
+        store::StoreConsts::elementNode,
+        createQName("http://www.w3.org/2005/xpath-functions","","analyze-string-result";),
+        NULL,
+        TypeConstants::QUANT_ONE,
+        false,
+        false
+      );
+
+  {
+    DECL_WITH_KIND(sctx, fn_analyze_string_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        lAnalyzeStringResultType),
+        FunctionConsts::FN_ANALYZE_STRING_2);
+
+  }
+
+
+  {
+    DECL_WITH_KIND(sctx, fn_analyze_string_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        lAnalyzeStringResultType),
+        FunctionConsts::FN_ANALYZE_STRING_3);
+  }
+}
+
 }
 
 /* vim:set et sw=2 ts=2: */

=== added file 'src/functions/func_strings_impl.h'
--- src/functions/func_strings_impl.h	1970-01-01 00:00:00 +0000
+++ src/functions/func_strings_impl.h	2012-03-15 15:00:28 +0000
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006-2012 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+#ifndef ZORBA_FUNCTIONS_STRINGS_IMPL_H
+#define ZORBA_FUNCTIONS_STRINGS_IMPL_H
+
+
+#include "common/shared_types.h"
+#include "functions/function.h"
+#include "functions/function_impl.h"
+#include "functions/function_consts.h"
+
+
+namespace zorba {
+
+
+void populate_context_strings_impl(static_context* sctx);
+
+
+} //namespace zorba
+
+
+#endif 
+/* vim:set et sw=2 ts=2: */
+

=== modified file 'src/functions/library.cpp'
--- src/functions/library.cpp	2012-03-07 15:49:25 +0000
+++ src/functions/library.cpp	2012-03-15 15:00:28 +0000
@@ -57,6 +57,7 @@
 #include "functions/func_sequences.h"
 #include "functions/func_sequences_impl.h"
 #include "functions/func_strings.h"
+#include "functions/func_strings_impl.h"
 #include "functions/func_uris.h"
 #include "functions/func_json.h"
 #include "functions/func_var_decl.h"
@@ -122,6 +123,7 @@
   populate_context_schema(sctx);
   populate_context_sctx(sctx);
   populate_context_strings(sctx);
+  populate_context_strings_impl(sctx);
   populate_context_uris(sctx);
   populate_context_sequences(sctx);
   populate_context_sequences_impl(sctx);

=== modified file 'src/functions/pregenerated/func_strings.cpp'
--- src/functions/pregenerated/func_strings.cpp	2012-02-16 12:48:17 +0000
+++ src/functions/pregenerated/func_strings.cpp	2012-03-15 15:00:28 +0000
@@ -853,33 +853,6 @@
   {
     
 
-    DECL_WITH_KIND(sctx, fn_analyze_string_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.ELEMENT_TYPE_ONE),
-        FunctionConsts::FN_ANALYZE_STRING_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_analyze_string_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.ELEMENT_TYPE_ONE),
-        FunctionConsts::FN_ANALYZE_STRING_3);
-
-  }
-
-
-  {
-    
-
     DECL_WITH_KIND(sctx, fn_zorba_string_materialize,
         (createQName("http://www.zorba-xquery.com/modules/string","","materialize";), 
         GENV_TYPESYSTEM.STRING_TYPE_ONE, 

=== modified file 'src/runtime/spec/strings/strings.xml'
--- src/runtime/spec/strings/strings.xml	2012-01-11 17:30:25 +0000
+++ src/runtime/spec/strings/strings.xml	2012-03-15 15:00:28 +0000
@@ -668,7 +668,7 @@
     fn:analyze-string
   </zorba:description>
 
-  <zorba:function>
+  <zorba:function generateDECL="false">
     <zorba:signature localname="analyze-string" prefix="fn" version="3.0">
       <zorba:param>xs:string?</zorba:param>
       <zorba:param>xs:string</zorba:param>


Follow ups