[libixion] 01/03: New upstream version 0.12.2

Rene Engelhard rene at moszumanska.debian.org
Sun Dec 25 17:28:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

rene pushed a commit to branch experimental
in repository libixion.

commit c3bec884523845f66c3ca2ccec6774b671d959eb
Author: Rene Engelhard <rene at debian.org>
Date:   Sun Dec 25 18:23:50 2016 +0100

    New upstream version 0.12.2
---
 ChangeLog                              | 54 ++++++++++++++++++++++++++++++++++
 README                                 |  2 ++
 configure                              | 24 +++++++--------
 configure.ac                           |  2 +-
 include/ixion/address.hpp              |  9 ++++--
 src/libixion/address.cpp               |  6 ++++
 src/libixion/formula_lexer.cpp         |  5 ++++
 src/libixion/formula_name_resolver.cpp | 11 +++----
 src/libixion/ixion_test.cpp            | 31 ++++++++++++++++---
 9 files changed, 118 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9daa3b4..646b0be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,59 @@
 # Generated by Makefile. Do not edit.
 
+commit 59c2852a4ccc2fc736e0a11a1135bf5de881c8d4
+Author: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date:   Wed Dec 14 21:01:02 2016 -0500
+
+    Up the version to 0.12.2.
+
+commit 95abcd359ebe848566d710e7b3ad54bb35138252
+Author: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date:   Wed Dec 14 20:59:54 2016 -0500
+
+    Update the CHANGELOG.
+
+commit 7c75ce333a27c808069d9b7f541968d4cad9181d
+Author: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date:   Wed Dec 14 20:55:22 2016 -0500
+
+    Fix lexer tokenizer to get R1C1 addresses properly parsed.
+    
+    For now, a lexer name that contains a '[' and ']' pair can have any
+    characters in-between, in order to have e.g. 'R[-5]C' properly
+    parsed as a name.
+
+commit 5daa352543d12e10e81307210728dab3d0063ef5
+Author: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date:   Wed Dec 14 18:38:47 2016 -0500
+
+    Fix a range address parsing error.
+    
+    It previously failed to parse 'R[-5]C:R[-1]C'.
+
+commit 496bb1a2332f809029f934fd31ce1e2f0f434d7e
+Author: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date:   Tue Dec 13 22:46:24 2016 -0500
+
+    Add a test case that ixion currently fails to parse.
+
+commit 13a5896b9a8ed558b1ed23170d565e56e5a441f7
+Author: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date:   Thu Sep 29 20:10:12 2016 -0400
+
+    Export these hash::operator(...) symbols.
+
+commit 27e8cbda4bfab21c92cffc70d8478dd7b1ffcf42
+Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
+Date:   Wed Sep 21 23:36:47 2016 +0200
+
+    add CI config
+
+commit 51af38eb0788f95339cecb98f588d16643b98edb
+Author: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date:   Sat Sep 17 15:35:17 2016 -0400
+
+    Add entry to 0.12.1.
+
 commit f5d9be4201a23267b94d4c9584e27a53d6658b48
 Author: Kohei Yoshida <kohei.yoshida at gmail.com>
 Date:   Sat Sep 17 12:05:31 2016 -0400
diff --git a/README b/README
index 11ec255..e9fd28a 100644
--- a/README
+++ b/README
@@ -59,6 +59,8 @@ for both full and partial calculation modes.
 
 | Version | API Version | Release Date | Download | Check Sum | File Size (bytes) |
 |---------|-------------|--------------|----------|-----------|-------------------|
+| 0.12.1 | 0.12   | 2016-09-17 | [libixion-0.12.1.tar.xz](http://kohei.us/files/ixion/src/libixion-0.12.1.tar.xz) | sha256sum: 000820ba51109ec21cbdb7ea83c1fdb0acbcfeb55b4a6a80fe02b71d45c587c2 | 406300 |
+|        |        |            | [libixion-0.12.1.tar.gz](http://kohei.us/files/ixion/src/libixion-0.12.1.tar.gz) | sha256sum: 7d03679041f291456052ccff8710f591b955a8ca53bc1670df10f8741274775d | 628577 |
 | 0.12.0 | 0.12   | 2016-07-15 | [libixion-0.12.0.tar.xz](http://kohei.us/files/ixion/src/libixion-0.12.0.tar.xz) | sha256sum: 055b7b9e31663f0acb7f249d68ca08e480f8f5d43ef5e4bd57b2fb04242307b0 | 393284 |
 |        |        |            | [libixion-0.12.0.tar.gz](http://kohei.us/files/ixion/src/libixion-0.12.0.tar.gz) | sha256sum: ba1d6f78fe3f302723d286ffe1ec25571b7983a360184c66a88782177fe3496e | 601525 |
 | 0.11.1 | 0.11   | 2016-05-11 | [libixion-0.11.1.tar.xz](http://kohei.us/files/ixion/src/libixion-0.11.1.tar.xz) | sha256sum: c9e9f52580d618fa969fc0293f55af21a9c74bfb802e655c6bf239202f95bede | 366660 |
diff --git a/configure b/configure
index 6071b07..e40b82f 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libixion 0.12.1.
+# Generated by GNU Autoconf 2.69 for libixion 0.12.2.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libixion'
 PACKAGE_TARNAME='libixion'
-PACKAGE_VERSION='0.12.1'
-PACKAGE_STRING='libixion 0.12.1'
+PACKAGE_VERSION='0.12.2'
+PACKAGE_STRING='libixion 0.12.2'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1382,7 +1382,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libixion 0.12.1 to adapt to many kinds of systems.
+\`configure' configures libixion 0.12.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1453,7 +1453,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libixion 0.12.1:";;
+     short | recursive ) echo "Configuration of libixion 0.12.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1584,7 +1584,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libixion configure 0.12.1
+libixion configure 0.12.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2211,7 +2211,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libixion $as_me 0.12.1, which was
+It was created by libixion $as_me 0.12.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3076,7 +3076,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libixion'
- VERSION='0.12.1'
+ VERSION='0.12.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4273,11 +4273,11 @@ else
 fi
 
 
-IXION_VERSION=0.12.1
+IXION_VERSION=0.12.2
 IXION_API_VERSION=0.12
 IXION_MAJOR_VERSION=0
 IXION_MINOR_VERSION=12
-IXION_MICRO_VERSION=1
+IXION_MICRO_VERSION=2
 
 
 
@@ -19200,7 +19200,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libixion $as_me 0.12.1, which was
+This file was extended by libixion $as_me 0.12.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19266,7 +19266,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libixion config.status 0.12.1
+libixion config.status 0.12.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 5f53f88..0ab7558 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 
 m4_define([ixion_major_version], [0])
 m4_define([ixion_minor_version], [12])
-m4_define([ixion_micro_version], [1])
+m4_define([ixion_micro_version], [2])
 
 m4_define([ixion_major_api_version], [0])
 m4_define([ixion_minor_api_version], [12])
diff --git a/include/ixion/address.hpp b/include/ixion/address.hpp
index 18dd8f8..a1d34ae 100644
--- a/include/ixion/address.hpp
+++ b/include/ixion/address.hpp
@@ -96,7 +96,7 @@ struct IXION_DLLPUBLIC address_t
 
     struct hash
     {
-        size_t operator() (const address_t& addr) const;
+        IXION_DLLPUBLIC size_t operator() (const address_t& addr) const;
     };
 };
 
@@ -119,7 +119,7 @@ struct IXION_DLLPUBLIC abs_range_t
 
     struct hash
     {
-        size_t operator() (const abs_range_t& range) const;
+        IXION_DLLPUBLIC size_t operator() (const abs_range_t& range) const;
     };
 
     bool valid() const;
@@ -198,6 +198,11 @@ struct IXION_DLLPUBLIC range_t
     bool whole_row() const;
 
     abs_range_t to_abs(const abs_address_t& origin) const;
+
+    struct hash
+    {
+        IXION_DLLPUBLIC size_t operator() (const range_t& range) const;
+    };
 };
 
 IXION_DLLPUBLIC bool operator==(const range_t& left, const range_t& right);
diff --git a/src/libixion/address.cpp b/src/libixion/address.cpp
index e773b92..7b96e1c 100644
--- a/src/libixion/address.cpp
+++ b/src/libixion/address.cpp
@@ -316,6 +316,12 @@ abs_range_t range_t::to_abs(const abs_address_t& origin) const
     return ret;
 }
 
+size_t range_t::hash::operator() (const range_t& range) const
+{
+    address_t::hash adr_hash;
+    return adr_hash(range.first) + 65536*adr_hash(range.last);
+}
+
 bool operator==(const range_t& left, const range_t& right)
 {
     return left.first == right.first && left.last == right.last;
diff --git a/src/libixion/formula_lexer.cpp b/src/libixion/formula_lexer.cpp
index b1b873d..a9aeb9c 100644
--- a/src/libixion/formula_lexer.cpp
+++ b/src/libixion/formula_lexer.cpp
@@ -258,7 +258,12 @@ void tokenizer::name()
 
             --m_scope;
         }
+        else if (m_scope)
+        {
+            // Anything goes between '[' and ']' for now.
+        }
         else if (is_op(c))
+            // An operator is not part of a name. Bail out.
             break;
     }
 
diff --git a/src/libixion/formula_name_resolver.cpp b/src/libixion/formula_name_resolver.cpp
index a23f12e..68326db 100644
--- a/src/libixion/formula_name_resolver.cpp
+++ b/src/libixion/formula_name_resolver.cpp
@@ -770,8 +770,7 @@ parse_address_result parse_address_r1c1(const char*& p, const char* p_last, addr
         }
 
         ++p;
-        addr.abs_column = (*p != '[');
-        if (!addr.abs_column)
+        if (*p == '[')
         {
             // Relative column address.
             ++p;
@@ -784,12 +783,11 @@ parse_address_result parse_address_r1c1(const char*& p, const char* p_last, addr
                 return (*p == ']') ? parse_address_result::valid_address : parse_address_result::invalid;
 
             ++p;
-            if (*p == ':')
-                return (p == p_last) ? parse_address_result::invalid : parse_address_result::range_expected;
         }
         else if (is_digit(*p))
         {
             // Absolute column address.
+            addr.abs_column = true;
             addr.column = parse_number<col_t>(p, p_last);
             if (addr.column <= 0)
                 // absolute address with 0 or negative value is invalid.
@@ -801,11 +799,10 @@ parse_address_result parse_address_r1c1(const char*& p, const char* p_last, addr
                 return parse_address_result::valid_address;
 
             ++p;
-            if (*p == ':')
-                return (p == p_last) ? parse_address_result::invalid : parse_address_result::range_expected;
         }
     }
-    else if (*p == ':')
+
+    if (*p == ':')
         return (p == p_last) ? parse_address_result::invalid : parse_address_result::range_expected;
 
     return parse_address_result::invalid;
diff --git a/src/libixion/ixion_test.cpp b/src/libixion/ixion_test.cpp
index d6f896c..ff29165 100644
--- a/src/libixion/ixion_test.cpp
+++ b/src/libixion/ixion_test.cpp
@@ -308,6 +308,7 @@ void test_name_resolver_excel_r1c1()
         { "R[1]C2", false },
         { "R2C[-2]", false },
         { "R1C", false },
+        { "R[-3]C", false },
         { "RC2", false },
         { "One!R10C", true },
         { "Two!C[-2]", true },
@@ -319,6 +320,7 @@ void test_name_resolver_excel_r1c1()
     {
         const char* p = single_ref_names[i].name;
         string name_r1c1(p);
+        cout << "Parsing " << name_r1c1 << endl;
         formula_name_t res = resolver->resolve(name_r1c1.data(), name_r1c1.size(), abs_address_t());
         if (res.type != formula_name_t::cell_reference)
         {
@@ -448,6 +450,7 @@ void test_name_resolver_excel_r1c1()
     {
         { "R2C2:R3C3", false },
         { "R[-3]C2:R[-1]C3", false },
+        { "R[-5]C:R[-1]C", false },
         { "'A B C'!R2:R4", true },
         { "'80''s Music'!C[2]:C[4]", true },
         { 0, false },
@@ -457,6 +460,7 @@ void test_name_resolver_excel_r1c1()
     {
         const char* p = range_ref_names[i].name;
         string name_r1c1(p);
+        cout << "Parsing " << name_r1c1 << endl;
         formula_name_t res = resolver->resolve(&name_r1c1[0], name_r1c1.size(), abs_address_t());
         if (res.type != formula_name_t::range_reference)
         {
@@ -608,7 +612,10 @@ bool check_formula_expression(
 void test_parse_and_print_expressions()
 {
     cout << "test public formula api" << endl;
-    const char* exps[] = {
+
+    // Excel A1
+
+    std::vector<const char*> exps = {
         "1/3*1.4",
         "2.3*(1+2)/(34*(3-2))",
         "SUM(1,2,3)",
@@ -629,17 +636,33 @@ void test_parse_and_print_expressions()
         "Table1[[#Headers],[Category]:[Value]]",
         "Table1[[#Headers],[#Data],[Category]:[Value]]",
     };
-    size_t num_exps = sizeof(exps) / sizeof(exps[0]);
+
     model_context cxt;
     cxt.append_string(IXION_ASCII("Table1"));
     cxt.append_string(IXION_ASCII("Category"));
     cxt.append_string(IXION_ASCII("Value"));
+
     auto resolver = formula_name_resolver::get(formula_name_resolver_t::excel_a1, &cxt);
     assert(resolver);
 
-    for (size_t i = 0; i < num_exps; ++i)
+    for (const char* exp : exps)
+    {
+        bool result = check_formula_expression(cxt, *resolver, exp);
+        assert(result);
+    }
+
+    // Excel R1C1
+
+    exps = {
+        "SUM(R[-5]C:R[-1]C)",
+    };
+
+    resolver = formula_name_resolver::get(formula_name_resolver_t::excel_r1c1, &cxt);
+    assert(resolver);
+
+    for (const char* exp : exps)
     {
-        bool result = check_formula_expression(cxt, *resolver, exps[i]);
+        bool result = check_formula_expression(cxt, *resolver, exp);
         assert(result);
     }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/libixion.git



More information about the Pkg-openoffice-commits mailing list