Merge lp:~zorba-coders/zorba/bug-1123163 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Chris Hillery
Approved revision: 11355
Merged at revision: 11331
Proposed branch: lp:~zorba-coders/zorba/bug-1123163
Merge into: lp:zorba
Diff against target: 4418 lines (+1396/-1500)
204 files modified
ChangeLog (+1/-0)
include/zorba/pregenerated/diagnostic_list.h (+0/-4)
modules/w3c/pregenerated/xqt-errors.xq (+1/-17)
src/diagnostics/diagnostic_en.xml (+41/-48)
src/diagnostics/pregenerated/diagnostic_list.cpp (+0/-6)
src/diagnostics/pregenerated/dict_en.cpp (+14/-11)
src/diagnostics/pregenerated/dict_zed_keys.h (+13/-8)
src/runtime/CMakeLists.txt (+1/-1)
src/runtime/durations_dates_times/format_dateTime.cpp (+131/-246)
src/runtime/numerics/format_integer.cpp (+801/-945)
src/runtime/numerics/pregenerated/numerics.h (+0/-9)
src/runtime/spec/numerics/numerics.xml (+3/-69)
src/util/ascii_util.h (+24/-0)
src/util/string_util.cpp (+135/-0)
src/util/string_util.h (+35/-0)
src/util/unicode_categories.cpp (+16/-0)
src/util/unicode_util.h (+34/-4)
src/zorbatypes/integer.cpp (+7/-10)
test/fots/CMakeLists.txt (+1/-16)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-01.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-04.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-07.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-08.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-09.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-2.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-5.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-6.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-7.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-I-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Wo-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Wwo.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-4.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-5.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-2.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-4.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-5.xml.res (+1/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ1.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ6.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ7.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ9.xml.res (+0/-1)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En3.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En4.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En5.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En8.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En9.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman3.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman4.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman5.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman6.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman7.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman9.xml.res (+0/-1)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal10.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal2.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal6.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal7.xml.res (+0/-2)
test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal9.xml.res (+0/-2)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.xq (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.spec (+1/-0)
test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-01.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-02.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-03.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-04.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-05.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-06.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-07.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-08.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-1-09.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-A-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-A-2.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-A-3.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-A-4.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-A-5.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-A-6.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-A-7.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-I-2.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtStart.spec (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtStart.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.spec (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-2.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-3.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-4.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-5.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-6.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-7.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Wo-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-Wwo.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-i-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-i-3.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-i-4.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-i-5.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-one-01.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-one-02.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-one-03.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-one-04.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-one-05.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-one-06.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-w-1.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-w-2.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-w-3.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-w-4.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-w-5.xq (+1/-1)
test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-2.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-3.xq (+1/-0)
test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ1.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ6.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ7.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.spec (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ9.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_En3.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_En4.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.spec (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_En8.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_En9.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman3.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman4.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman5.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman6.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman7.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.spec (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman9.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal10.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal2.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal6.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal7.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.spec (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.xq (+0/-1)
test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal9.xq (+0/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1123163
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Matthias Brantner Approve
Nicolae Brinza Approve
Paul J. Lucas Approve
Review via email: mp+156322@code.launchpad.net

Commit message

Rewrote format-integer() code -- fixed all bugs. Note that tests 049, 050, and 052 should not be run because we're electing not to implement the functionality.

Description of the change

Rewrote format-integer() code -- fixed all bugs. Note that tests 049, 050, and 052 should not be run because we're electing not to implement the functionality.

Also some format-date() code clean-up as well as factoring common code out.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
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 bug-1123163-2013-04-01T02-54-19.028Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve.

lp:~zorba-coders/zorba/bug-1123163 updated
11355. By Paul J. Lucas

Fixed comment.

Revision history for this message
Nicolae Brinza (nbrinza) :
review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Removing errors breaks api compatibility. I leave it for Chris
to take a decision on whether this needs to be fixed.

review: Approve
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

> Removing errors breaks api compatibility.

Removing what errors? Which API?

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

On Apr 1, 2013, at 12:05 PM, "Paul J. Lucas" <email address hidden> wrote:

>> Removing errors breaks api compatibility.
>
> Removing what errors?
FOFI0001 and FOFI0002

> Which API?
 include/zorba/pregenerated/diagnostic_list.h

> --
> https://code.launchpad.net/~zorba-coders/zorba/bug-1123163/+merge/156322
> You are reviewing the proposed merge of lp:~zorba-coders/zorba/bug-1123163 into lp:zorba.

Revision history for this message
Chris Hillery (ceejatec) wrote :

As they were likely unused, I don't have a problem with those removals. Not sure how to handle this situation more generally going forward.

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 bug-1123163-2013-04-02T00-02-44.075Z 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-24 20:40:03 +0000
3+++ ChangeLog 2013-04-01 03:35:28 +0000
4@@ -39,6 +39,7 @@
5 * Fixed bug #1124273 (xqdoc crash because of annotation literals)
6 * Fixed bug #867027 (XQST0059 error messages inconsistent)
7 * Fixed bug #1095889 (Improve error message for xml-parsing error).
8+ * Fixed bug #1123163 (fn:format-integer failures)
9 * Fixed bug in index join rule (no index join if inner clause has positional var).
10 * Fixed bug in index join rule (copy var ids after cloning index domain expr).
11 * Fixed bug #1123162 (FOTS: formatting dates and times failures)
12
13=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
14--- include/zorba/pregenerated/diagnostic_list.h 2013-03-22 17:19:01 +0000
15+++ include/zorba/pregenerated/diagnostic_list.h 2013-04-01 03:35:28 +0000
16@@ -262,10 +262,6 @@
17
18 extern ZORBA_DLL_PUBLIC XQueryErrorCode FODT0003;
19
20-extern ZORBA_DLL_PUBLIC XQueryErrorCode FOFI0001;
21-
22-extern ZORBA_DLL_PUBLIC XQueryErrorCode FOFI0002;
23-
24 extern ZORBA_DLL_PUBLIC XQueryErrorCode FONS0004;
25
26 extern ZORBA_DLL_PUBLIC XQueryErrorCode FONS0005;
27
28=== modified file 'modules/w3c/pregenerated/xqt-errors.xq'
29--- modules/w3c/pregenerated/xqt-errors.xq 2013-03-21 19:33:22 +0000
30+++ modules/w3c/pregenerated/xqt-errors.xq 2013-04-01 03:35:28 +0000
31@@ -1113,7 +1113,7 @@
32
33 (:~
34 :
35- : Invalid \c fn:format-number() picture string.
36+ : Invalid decimal/integer format picture string.
37 :
38 : @see http://www.w3.org/2005/xqt-errors
39 :)
40@@ -1145,22 +1145,6 @@
41
42 (:~
43 :
44- : format-integer: Cannot cast $language to \c xs:language.
45- :
46- : @see http://www.w3.org/2005/xqt-errors
47-:)
48-declare variable $err:FOFI0001 as xs:QName := fn:QName($err:NS, "err:FOFI0001");
49-
50-(:~
51- :
52- : format-integer: invalid parameter.
53- :
54- : @see http://www.w3.org/2005/xqt-errors
55-:)
56-declare variable $err:FOFI0002 as xs:QName := fn:QName($err:NS, "err:FOFI0002");
57-
58-(:~
59- :
60 : No namespace found for prefix.
61 :
62 : @see http://www.w3.org/2005/xqt-errors
63
64=== modified file 'src/diagnostics/diagnostic_en.xml'
65--- src/diagnostics/diagnostic_en.xml 2013-03-24 19:05:42 +0000
66+++ src/diagnostics/diagnostic_en.xml 2013-04-01 03:35:28 +0000
67@@ -1028,12 +1028,21 @@
68 <entry key="BadComponent_3">
69 <value>'$3': invalid component specifier</value>
70 </entry>
71+ <entry key="Bad2ndModifier_3">
72+ <value>'$3': invalid second presentation modifier</value>
73+ </entry>
74+ <entry key="Bad2ndModifierHere_3">
75+ <value>'$3': valid second presentation modifier invalid here</value>
76+ </entry>
77 <entry key="BadWidthModifier">
78 <value>invalid width modifier</value>
79 </entry>
80 <entry key="DigitNotSameFamily_34">
81 <value>"$3": digit not from same digit family as $4</value>
82 </entry>
83+ <entry key="Dup2ndModifier_3">
84+ <value>"$3": duplicate second presentation modifier</value>
85+ </entry>
86 <entry key="MultipleComponent_3">
87 <value>'$3': multiple component specifiers between []</value>
88 </entry>
89@@ -1300,9 +1309,39 @@
90
91 <diagnostic code="FODF1310">
92 <comment>
93- Invalid \c fn:format-number() picture string.
94+ Invalid decimal/integer format picture string.
95 </comment>
96- <value>"$1": invalid fn:format-number() picture string$2</value>
97+ <value>"$1": invalid picture string for decimal/integer${: 2}</value>
98+ <entry key="BadCharacter_3">
99+ <value>'$3': invalid character</value>
100+ </entry>
101+ <entry key="BadFormatModifier_3">
102+ <value>'$3': invalid format modifier</value>
103+ </entry>
104+ <entry key="BadFormatModifierHere_3">
105+ <value>'$3': valid format modifier invalid here</value>
106+ </entry>
107+ <entry key="DigitNotSameFamily_34">
108+ <value>"$3": digit not from same digit family as $4</value>
109+ </entry>
110+ <entry key="DupFormatModifier_3">
111+ <value>"$3": duplicate format modifier</value>
112+ </entry>
113+ <entry key="EmptyFormat">
114+ <value>empty primary format</value>
115+ </entry>
116+ <entry key="NoAdjacentGroupSep_3">
117+ <value>"$3": grouping separator must not be adjacent to others</value>
118+ </entry>
119+ <entry key="NoGroupSepAtStart_3">
120+ <value>"$3": grouping separator illegal at start of decimal-digit-pattern</value>
121+ </entry>
122+ <entry key="NoGroupSepAtEnd_3">
123+ <value>"$3": grouping separator illegal at end of decimal-digit-pattern</value>
124+ </entry>
125+ <entry key="NoOptDigitAfterMandatory">
126+ <value>"#": optional-digit-sign must precede all mandatory-digit-signs</value>
127+ </entry>
128 </diagnostic>
129
130 <diagnostic code="FODT0001">
131@@ -1326,20 +1365,6 @@
132 <value>"$1": invalid timezone value (in seconds)</value>
133 </diagnostic>
134
135- <diagnostic code="FOFI0001">
136- <comment>
137- format-integer: Cannot cast $language to \c xs:language.
138- </comment>
139- <value>"$1": not castable to xs:language</value>
140- </diagnostic>
141-
142- <diagnostic code="FOFI0002">
143- <comment>
144- format-integer: invalid parameter.
145- </comment>
146- <value>invalid argument in format-integer: $1</value>
147- </diagnostic>
148-
149 <diagnostic code="FONS0004">
150 <comment>
151 No namespace found for prefix.
152@@ -4215,38 +4240,6 @@
153 <value>error</value>
154 </entry>
155
156- <entry key="format_integer_bad_picture_format">
157- <value>bad $picture format: $2</value>
158- </entry>
159-
160- <entry key="format_integer_duplicated_optional_format_modifier">
161- <value>duplicated optional format modifier '$2'</value>
162- </entry>
163-
164- <entry key="format_integer_optional_format_modifier_not_closed">
165- <value>bad optional format modifier ($2), cannot find closing ')' </value>
166- </entry>
167-
168- <entry key="format_integer_picture_empty">
169- <value>$picture parameter should not be empty</value>
170- </entry>
171-
172- <entry key="format_integer_unknown_optional_format_modifier_character">
173- <value>unknown optional format modifier character '$2'</value>
174- </entry>
175-
176- <entry key="format_integer_value_1_10">
177- <value>$value ($2) should be between 1 and 10 for this formatting picture</value>
178- </entry>
179-
180- <entry key="format_integer_value_1_20">
181- <value>$value ($2) should be between 1 and 20 for this formatting picture</value>
182- </entry>
183-
184- <entry key="format_integer_value_gt_3000">
185- <value>$value ($2) should be less than 3000 for Roman representation</value>
186- </entry>
187-
188 <entry key="full-text dynamic error">
189 <value>full-text dynamic error</value>
190 </entry>
191
192=== modified file 'src/diagnostics/pregenerated/diagnostic_list.cpp'
193--- src/diagnostics/pregenerated/diagnostic_list.cpp 2013-03-22 17:19:01 +0000
194+++ src/diagnostics/pregenerated/diagnostic_list.cpp 2013-04-01 03:35:28 +0000
195@@ -375,12 +375,6 @@
196 XQueryErrorCode FODT0003( "FODT0003" );
197
198
199-XQueryErrorCode FOFI0001( "FOFI0001" );
200-
201-
202-XQueryErrorCode FOFI0002( "FOFI0002" );
203-
204-
205 XQueryErrorCode FONS0004( "FONS0004" );
206
207
208
209=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
210--- src/diagnostics/pregenerated/dict_en.cpp 2013-03-24 19:05:42 +0000
211+++ src/diagnostics/pregenerated/dict_en.cpp 2013-04-01 03:35:28 +0000
212@@ -48,15 +48,13 @@
213 { "FODC0006", "invalid content passed to $1: $2" },
214 { "FODC0007", "\"$1\": base URI passed to fn:parse() is not a valid absolute URI" },
215 { "FODF1280", "\"$1\": invalid decimal format name for fn:format-number()" },
216- { "FODF1310", "\"$1\": invalid fn:format-number() picture string$2" },
217+ { "FODF1310", "\"$1\": invalid picture string for decimal/integer${: 2}" },
218 { "FODT0001", "overflow/underflow in date/time operation" },
219 { "FODT0002", "overflow/underflow in duration operation" },
220 { "FODT0003", "\"$1\": invalid timezone value (in seconds)" },
221 { "FOER0000", "unidentifier error" },
222 { "FOFD1340", "\"$1\": invalid picture string for date/time${: 2}" },
223 { "FOFD1350", "\"$1\": component specifier not available" },
224- { "FOFI0001", "\"$1\": not castable to xs:language" },
225- { "FOFI0002", "invalid argument in format-integer: $1" },
226 { "FOFL0001", "dynamic call on context-dependent function item" },
227 { "FONS0004", "\"$1\": no namespace found for prefix" },
228 { "FONS0005", "base-URI not defined in the static context" },
229@@ -618,9 +616,22 @@
230 { "~FOCA0002_BadLexicalQName_2", "\"$2\": value is not a valid lexical QName" },
231 { "~FOCA0002_NoCastTo_234", "\"$2\": value of type $3 is not castable to type $4" },
232 { "~FOCA0002_NoURIforPrefix_2", "no namespace URI provided for prefix in lexical QName \"$2\"" },
233+ { "~FODF1310_BadCharacter_3", "'$3': invalid character" },
234+ { "~FODF1310_BadFormatModifierHere_3", "'$3': valid format modifier invalid here" },
235+ { "~FODF1310_BadFormatModifier_3", "'$3': invalid format modifier" },
236+ { "~FODF1310_DigitNotSameFamily_34", "\"$3\": digit not from same digit family as $4" },
237+ { "~FODF1310_DupFormatModifier_3", "\"$3\": duplicate format modifier" },
238+ { "~FODF1310_EmptyFormat", "empty primary format" },
239+ { "~FODF1310_NoAdjacentGroupSep_3", "\"$3\": grouping separator must not be adjacent to others" },
240+ { "~FODF1310_NoGroupSepAtEnd_3", "\"$3\": grouping separator illegal at end of decimal-digit-pattern" },
241+ { "~FODF1310_NoGroupSepAtStart_3", "\"$3\": grouping separator illegal at start of decimal-digit-pattern" },
242+ { "~FODF1310_NoOptDigitAfterMandatory", "\"#\": optional-digit-sign must precede all mandatory-digit-signs" },
243+ { "~FOFD1340_Bad2ndModifierHere_3", "'$3': valid second presentation modifier invalid here" },
244+ { "~FOFD1340_Bad2ndModifier_3", "'$3': invalid second presentation modifier" },
245 { "~FOFD1340_BadComponent_3", "'$3': invalid component specifier" },
246 { "~FOFD1340_BadWidthModifier", "invalid width modifier" },
247 { "~FOFD1340_DigitNotSameFamily_34", "\"$3\": digit not from same digit family as $4" },
248+ { "~FOFD1340_Dup2ndModifier_3", "\"$3\": duplicate second presentation modifier" },
249 { "~FOFD1340_MultipleComponent_3", "'$3': multiple component specifiers between []" },
250 { "~FOFD1340_MustBeOneMandatoryDigit", "there must be at least one mandatory-digit-sign" },
251 { "~FOFD1340_NoAdjacentGroupSep_3", "\"$3\": grouping separator must not be adjacent to others" },
252@@ -1002,14 +1013,6 @@
253 { "~dynamic error", "dynamic error" },
254 { "~dynamic warning", "dynamic warning" },
255 { "~error", "error" },
256- { "~format_integer_bad_picture_format", "bad $picture format: $2" },
257- { "~format_integer_duplicated_optional_format_modifier", "duplicated optional format modifier '$2'" },
258- { "~format_integer_optional_format_modifier_not_closed", "bad optional format modifier ($2), cannot find closing ')' " },
259- { "~format_integer_picture_empty", "$picture parameter should not be empty" },
260- { "~format_integer_unknown_optional_format_modifier_character", "unknown optional format modifier character '$2'" },
261- { "~format_integer_value_1_10", "$value ($2) should be between 1 and 10 for this formatting picture" },
262- { "~format_integer_value_1_20", "$value ($2) should be between 1 and 20 for this formatting picture" },
263- { "~format_integer_value_gt_3000", "$value ($2) should be less than 3000 for Roman representation" },
264 { "~full-text dynamic error", "full-text dynamic error" },
265 { "~full-text dynamic warning", "full-text dynamic warning" },
266 { "~full-text static error", "full-text static error" },
267
268=== modified file 'src/diagnostics/pregenerated/dict_zed_keys.h'
269--- src/diagnostics/pregenerated/dict_zed_keys.h 2013-03-24 19:05:42 +0000
270+++ src/diagnostics/pregenerated/dict_zed_keys.h 2013-04-01 03:35:28 +0000
271@@ -64,8 +64,11 @@
272 #define ZED_XQDY0074_NoEmptyLocalname "~XQDY0074_NoEmptyLocalname"
273 #define ZED_XQDY0074_NameSapceConstructor "~XQDY0074_NameSapceConstructor"
274 #define ZED_FOFD1340_BadComponent_3 "~FOFD1340_BadComponent_3"
275+#define ZED_FOFD1340_Bad2ndModifier_3 "~FOFD1340_Bad2ndModifier_3"
276+#define ZED_FOFD1340_Bad2ndModifierHere_3 "~FOFD1340_Bad2ndModifierHere_3"
277 #define ZED_FOFD1340_BadWidthModifier "~FOFD1340_BadWidthModifier"
278 #define ZED_FOFD1340_DigitNotSameFamily_34 "~FOFD1340_DigitNotSameFamily_34"
279+#define ZED_FOFD1340_Dup2ndModifier_3 "~FOFD1340_Dup2ndModifier_3"
280 #define ZED_FOFD1340_MultipleComponent_3 "~FOFD1340_MultipleComponent_3"
281 #define ZED_FOFD1340_MustBeOneMandatoryDigit "~FOFD1340_MustBeOneMandatoryDigit"
282 #define ZED_FOFD1340_NoComponent "~FOFD1340_NoComponent"
283@@ -80,6 +83,16 @@
284 #define ZED_FOCA0002_BadLexicalQName_2 "~FOCA0002_BadLexicalQName_2"
285 #define ZED_FOCA0002_NoURIforPrefix_2 "~FOCA0002_NoURIforPrefix_2"
286 #define ZED_FOCA0002_NoCastTo_234 "~FOCA0002_NoCastTo_234"
287+#define ZED_FODF1310_BadCharacter_3 "~FODF1310_BadCharacter_3"
288+#define ZED_FODF1310_BadFormatModifier_3 "~FODF1310_BadFormatModifier_3"
289+#define ZED_FODF1310_BadFormatModifierHere_3 "~FODF1310_BadFormatModifierHere_3"
290+#define ZED_FODF1310_DigitNotSameFamily_34 "~FODF1310_DigitNotSameFamily_34"
291+#define ZED_FODF1310_DupFormatModifier_3 "~FODF1310_DupFormatModifier_3"
292+#define ZED_FODF1310_EmptyFormat "~FODF1310_EmptyFormat"
293+#define ZED_FODF1310_NoAdjacentGroupSep_3 "~FODF1310_NoAdjacentGroupSep_3"
294+#define ZED_FODF1310_NoGroupSepAtStart_3 "~FODF1310_NoGroupSepAtStart_3"
295+#define ZED_FODF1310_NoGroupSepAtEnd_3 "~FODF1310_NoGroupSepAtEnd_3"
296+#define ZED_FODF1310_NoOptDigitAfterMandatory "~FODF1310_NoOptDigitAfterMandatory"
297 #define ZED_FORG0001_BadHexDigit_2 "~FORG0001_BadHexDigit_2"
298 #define ZED_FORG0001_Base64BadChar_2 "~FORG0001_Base64BadChar_2"
299 #define ZED_FORG0001_Base64Multiple4 "~FORG0001_Base64Multiple4"
300@@ -344,14 +357,6 @@
301 #define ZED_XUST0002_UDF_2 "~XUST0002_UDF_2"
302 #define ZED_ZeroLenURI "~ZeroLenURI"
303 #define ZED_error "~error"
304-#define ZED_format_integer_bad_picture_format "~format_integer_bad_picture_format"
305-#define ZED_format_integer_duplicated_optional_format_modifier "~format_integer_duplicated_optional_format_modifier"
306-#define ZED_format_integer_optional_format_modifier_not_closed "~format_integer_optional_format_modifier_not_closed"
307-#define ZED_format_integer_picture_empty "~format_integer_picture_empty"
308-#define ZED_format_integer_unknown_optional_format_modifier_character "~format_integer_unknown_optional_format_modifier_character"
309-#define ZED_format_integer_value_1_10 "~format_integer_value_1_10"
310-#define ZED_format_integer_value_1_20 "~format_integer_value_1_20"
311-#define ZED_format_integer_value_gt_3000 "~format_integer_value_gt_3000"
312 #define ZED_warning "~warning"
313 #define ZED_xqueryx_empty_content "~xqueryx_empty_content"
314 #define ZED_ParseFragmentOptionCombinationNotAllowed "~ParseFragmentOptionCombinationNotAllowed"
315
316=== modified file 'src/runtime/CMakeLists.txt'
317--- src/runtime/CMakeLists.txt 2013-03-27 07:55:14 +0000
318+++ src/runtime/CMakeLists.txt 2013-04-01 03:35:28 +0000
319@@ -132,7 +132,7 @@
320 json/jsonml_array.cpp
321 json/snelson.cpp
322 numerics/NumericsImpl.cpp
323- numerics/format_integer_impl.cpp
324+ numerics/format_integer.cpp
325 sequences/SequencesImpl.cpp
326 visitors/iterprinter.cpp
327 update/update.cpp
328
329=== modified file 'src/runtime/durations_dates_times/format_dateTime.cpp'
330--- src/runtime/durations_dates_times/format_dateTime.cpp 2013-03-28 05:22:18 +0000
331+++ src/runtime/durations_dates_times/format_dateTime.cpp 2013-04-01 03:35:28 +0000
332@@ -18,18 +18,14 @@
333
334 // standard
335 #include <algorithm>
336-#include <cctype>
337 #include <cmath>
338 #include <cstdlib>
339-#include <functional>
340 #include <iomanip>
341 #include <iostream>
342 #include <sstream>
343
344 // Zorba
345 #include "context/dynamic_context.h"
346-#include "context/static_context.h"
347-#include "runtime/core/arithmetic_impl.h"
348 #include "runtime/visitors/planiter_visitor.h"
349 #include "store/api/item.h"
350 #include "store/api/item_factory.h"
351@@ -41,8 +37,6 @@
352 #include "util/time_util.h"
353 #include "util/utf8_util.h"
354 #include "zorbatypes/datetime.h"
355-#include "zorbatypes/datetime/parse.h"
356-#include "zorbatypes/duration.h"
357 #include "zorbatypes/zstring.h"
358 #include "zorbautils/locale.h"
359
360@@ -79,13 +73,13 @@
361 military_tz // 'Z' : A B C ... J ... X Y Z
362 };
363
364- enum second_co_type {
365+ enum co_type {
366 no_second_co,
367 cardinal, // 'c': 7 or seven
368 ordinal // 'o': 7th or seventh
369 };
370
371- enum second_at_type {
372+ enum at_type {
373 no_second_at,
374 alphabetic, // 'a'
375 traditional // 't'
376@@ -102,9 +96,9 @@
377 } first;
378
379 struct {
380- second_co_type co_type;
381+ co_type co;
382 zstring co_string;
383- second_at_type at_type;
384+ at_type at;
385 } second;
386
387 width_type min_width;
388@@ -112,7 +106,7 @@
389
390 //
391 // This stuff isn't part of the "presentation modifier" as discussed in the
392- // XQuery3.0 F&O spec, but this is a convenient place to put it nonetheless.
393+ // XQuery 3.0 F&O spec, but this is a convenient place to put it nonetheless.
394 //
395 iso639_1::type lang;
396 bool lang_is_fallback;
397@@ -162,8 +156,8 @@
398 first.type = arabic;
399 first.has_grouping_separators = false;
400 first.zero = '0';
401- second.co_type = cardinal;
402- second.at_type = no_second_at;
403+ second.co = cardinal;
404+ second.at = no_second_at;
405 min_width = max_width = 0;
406 };
407
408@@ -173,219 +167,20 @@
409
410 ///////////////////////////////////////////////////////////////////////////////
411
412-zstring alpha( unsigned n, bool capital ) {
413- zstring result;
414- if ( n ) {
415- char const c = capital ? 'A' : 'a';
416- while ( n ) {
417- unsigned const m = n - 1;
418- result.insert( (zstring::size_type)0, 1, c + m % 26 );
419- n = m / 26;
420- }
421- } else
422- result = "0";
423- return result;
424-}
425-
426-///////////////////////////////////////////////////////////////////////////////
427-
428-namespace english_impl {
429-
430-// Based on code from:
431-// http://www.cprogramming.com/challenges/integer-to-english-sol.html
432-
433-static string const ones[][2] = {
434- { "", "" },
435- { "one", "first" },
436- { "two", "second" },
437- { "three", "third" },
438- { "four", "fourth" },
439- { "five", "fifth" },
440- { "six", "sixth" },
441- { "seven", "seventh" },
442- { "eight", "eighth" },
443- { "nine", "ninth" },
444- { "ten", "tenth" },
445- { "eleven", "eleventh" },
446- { "twelve", "twelfth" },
447- { "thirteen", "thirteenth" },
448- { "fourteen", "fourteenth" },
449- { "fifteen", "fifteenth" },
450- { "sixteen", "sixteenth" },
451- { "seventeen", "seventeenth" },
452- { "eighteen", "eighteenth" },
453- { "nineteen", "nineteenth" }
454-};
455-
456-static zstring const tens[][2] = {
457- { "", "" },
458- { "", "" },
459- { "twenty", "twentieth" },
460- { "thirty", "thirtieth" },
461- { "forty", "fortieth" },
462- { "fifty", "fiftieth" },
463- { "sixty", "sixtieth" },
464- { "seventy", "seventieth" },
465- { "eighty", "eighteenth" },
466- { "ninety", "ninetieth" }
467-};
468-
469-// Enough entries to print English for 64-bit integers.
470-static zstring const big[][2] = {
471- { "", "" },
472- { "thousand", "thousandth" },
473- { "million", "millionth" },
474- { "billion", "billionth" },
475- { "trillion", "trillionth" },
476- { "quadrillion", "quadrillionth" },
477- { "quintillion", "quintillionth" }
478-};
479-
480-inline zstring if_space( zstring const &s ) {
481- return s.empty() ? "" : ' ' + s;
482-}
483-
484-static zstring hundreds( int64_t n, bool ordinal ) {
485- if ( n < 20 )
486- return ones[ n ][ ordinal ];
487- zstring const tmp( if_space( ones[ n % 10 ][ ordinal ] ) );
488- return tens[ n / 10 ][ ordinal && tmp.empty() ] + tmp;
489-}
490-
491-} // namespace english_impl
492-
493-/**
494- * Converts a signed integer to English, e.g, 42 becomes "forty two".
495- *
496- * @param n The integer to convert.
497- * @param ordinal If \c true, ordinal words ("forty second") are returned.
498- * @return Returns \a n in English.
499- */
500-static zstring english( int64_t n, bool ordinal = false ) {
501- using namespace english_impl;
502-
503- if ( !n )
504- return ordinal ? "zeroth" : "zero";
505-
506- bool const negative = n < 0;
507- if ( negative )
508- n = -n;
509-
510- int big_count = 0;
511- bool big_ordinal = ordinal;
512- zstring r;
513-
514- while ( n ) {
515- if ( int64_t const m = n % 1000 ) {
516- zstring s;
517- if ( m < 100 )
518- s = hundreds( m, ordinal );
519- else {
520- zstring const tmp( if_space( hundreds( m % 100, ordinal ) ) );
521- s = ones[ m / 100 ][0] + ' '
522- + (ordinal && tmp.empty() ? "hundredth" : "hundred") + tmp;
523- }
524- zstring const tmp( if_space( r ) );
525- r = s + if_space( big[ big_count ][ big_ordinal && tmp.empty() ] + tmp );
526- big_ordinal = false;
527- }
528- n /= 1000;
529- ++big_count;
530- ordinal = false;
531- }
532-
533- if ( negative )
534- r = "negative " + r;
535- return r;
536-}
537-
538-///////////////////////////////////////////////////////////////////////////////
539-
540-static bool is_grouping_separator( unicode::code_point cp ) {
541- using namespace unicode;
542- //
543- // XQuery 3.0 F&O: 4.6.1: a grouping-separator-sign is a non-alphanumeric
544- // character, that is a character whose Unicode category is other than Nd,
545- // Nl, No, Lu, Ll, Lt, Lm or Lo.
546- //
547- return !( is_category( cp, Nd )
548- || is_category( cp, Nl )
549- || is_category( cp, No )
550- || is_category( cp, Lu )
551- || is_category( cp, Ll )
552- || is_category( cp, Lt )
553- || is_category( cp, Lm )
554- || is_category( cp, Lo )
555- );
556-}
557-
558-///////////////////////////////////////////////////////////////////////////////
559-
560-/**
561- * Returns the English ordinal suffix for an integer, e.g., "st" for 1, "nd"
562- * for 2, etc.
563- *
564- * @param n The integer to return the ordinal suffix for.
565- * @return Returns said suffix.
566- */
567-static char const* ordinal( int n ) {
568- n = std::abs( n );
569- switch ( n % 100 ) {
570- case 11:
571- case 12:
572- case 13:
573- break;
574- default:
575- switch ( n % 10 ) {
576- case 1: return "st";
577- case 2: return "nd";
578- case 3: return "rd";
579- }
580- }
581- return "th";
582-}
583-
584-///////////////////////////////////////////////////////////////////////////////
585-
586-/**
587- * A unary_function to convert a (presumed) lower-case string to title-case
588- * "Like This."
589- */
590-class to_title : public unary_function<char,char> {
591-public:
592- to_title() : capitalize_( true ) { }
593-
594- result_type operator()( argument_type c ) {
595- if ( ascii::is_alpha( c ) ) {
596- if ( capitalize_ ) {
597- c = ascii::to_upper( c );
598- capitalize_ = false;
599- }
600- } else if ( ascii::is_space( c ) )
601- capitalize_ = true;
602- return c;
603- };
604-
605-private:
606- bool capitalize_;
607-};
608-
609-///////////////////////////////////////////////////////////////////////////////
610-
611 static void append_number( int n, modifier const &mod, zstring *dest ) {
612 switch ( mod.first.type ) {
613 case modifier::arabic: {
614 utf8::itou_buf_type buf;
615 zstring tmp( utf8::itou( n, buf, mod.first.zero ) );
616- if ( mod.second.co_type == modifier::ordinal )
617- tmp += ordinal( n );
618+ if ( mod.second.co == modifier::ordinal )
619+ tmp += ztd::ordinal( n );
620 *dest += mod.left_pad_zero( &tmp );
621 break;
622 }
623
624 case modifier::alpha:
625 case modifier::ALPHA: {
626- zstring tmp( alpha( n, mod.first.type == modifier::ALPHA ) );
627+ zstring tmp( ztd::alpha( n, mod.first.type == modifier::ALPHA ) );
628 *dest += mod.right_pad_space( &tmp );
629 break;
630 }
631@@ -402,20 +197,20 @@
632 }
633
634 case modifier::words: {
635- zstring tmp( english( n, mod.second.co_type == modifier::ordinal ) );
636+ zstring tmp( ztd::english( n, mod.second.co == modifier::ordinal ) );
637 *dest += mod.right_pad_space( &tmp );
638 break;
639 }
640
641 case modifier::Words: {
642- zstring tmp( english( n, mod.second.co_type == modifier::ordinal ) );
643- std::transform( tmp.begin(), tmp.end(), tmp.begin(), to_title() );
644+ zstring tmp( ztd::english( n, mod.second.co == modifier::ordinal ) );
645+ std::transform( tmp.begin(), tmp.end(), tmp.begin(), ascii::to_title() );
646 *dest += mod.right_pad_space( &tmp );
647 break;
648 }
649
650 case modifier::WORDS: {
651- zstring tmp( english( n, mod.second.co_type == modifier::ordinal ) );
652+ zstring tmp( ztd::english( n, mod.second.co == modifier::ordinal ) );
653 ascii::to_upper( tmp );
654 *dest += mod.right_pad_space( &tmp );
655 break;
656@@ -607,7 +402,7 @@
657 tmp = "GMT";
658 }
659
660- if ( mod.second.at_type == modifier::traditional && !hour && !min ) {
661+ if ( mod.second.at == modifier::traditional && !hour && !min ) {
662 //
663 // Ibid: If the first presentation modifier is numeric, in any of the
664 // above formats, and the second presentation modifier is t, then a
665@@ -644,7 +439,7 @@
666 ++hm_width[ grouping_separators ];
667 continue;
668 }
669- if ( got_digit && is_grouping_separator( cp ) ) {
670+ if ( got_digit && unicode::is_grouping_separator( cp ) ) {
671 if ( ++grouping_separators == 1 ) {
672 zstring tmp2( utf8::itou( hour, buf, mod.first.zero ) );
673 tmp += utf8::left_pad( &tmp2, hm_width[0], mod.first.zero );
674@@ -820,7 +615,7 @@
675 utf8_string<zstring> u_mod_format( mod->first.format );
676 unicode::code_point cp = *u;
677
678- if ( cp != '#' && is_grouping_separator( cp ) ) {
679+ if ( cp != '#' && unicode::is_grouping_separator( cp ) ) {
680 //
681 // XQuery 3.0 F&O: 4.6.1: A grouping-separator-sign must not appear
682 // at the start ... of the decimal-digit-pattern ....
683@@ -912,7 +707,7 @@
684 break;
685 else if ( unicode::is_space( cp ) )
686 continue;
687- else if ( is_grouping_separator( cp ) ) {
688+ else if ( unicode::is_grouping_separator( cp ) ) {
689 if ( cp == ',' && !--commas ) {
690 //
691 // Ibid: if a variable marker contains one or more commas, then the
692@@ -1016,6 +811,37 @@
693 mod->first.parsed = true;
694 }
695
696+static void parse_variation( utf8_string<zstring const> const &u_picture_str,
697+ utf8_string<zstring const>::const_iterator *u,
698+ modifier *mod, QueryLoc const &loc ) {
699+ utf8_string<zstring const>::const_iterator &v = *u;
700+ if ( v == u_picture_str.end() )
701+ return;
702+ if ( *v == '(' ) {
703+ //
704+ // XQuery F&O 3.0 4.6.1: The string of characters between the parentheses,
705+ // if present, is used to select between other possible variations of
706+ // cardinal or ordinal numbering sequences. The interpretation of this
707+ // string is implementation-defined. No error occurs if the implementation
708+ // does not define any interpretation for the defined string.
709+ //
710+ utf8_string<zstring> u_pic_co_string( mod->second.co_string );
711+ while ( true ) {
712+ if ( ++v == u_picture_str.end() )
713+ throw XQUERY_EXCEPTION(
714+ err::FOFD1340,
715+ ERROR_PARAMS( *u_picture_str.get(), ZED( CharExpected_3 ), ')' ),
716+ ERROR_LOC( loc )
717+ );
718+ unicode::code_point const cp = *v;
719+ if ( cp == ')' )
720+ break;
721+ u_pic_co_string += cp;
722+ }
723+ ++v;
724+ }
725+}
726+
727 static void parse_second_modifier( zstring const &picture_str,
728 zstring::const_iterator *i, modifier *mod,
729 QueryLoc const &loc ) {
730@@ -1023,29 +849,86 @@
731 ascii::skip_whitespace( picture_str, &j );
732 if ( j == picture_str.end() )
733 return;
734- switch ( *j ) {
735- case 'c': mod->second.co_type = modifier::cardinal ; break;
736- case 'o': mod->second.co_type = modifier::ordinal ; break;
737- case 'a': mod->second.at_type = modifier::alphabetic ; ++j; return;
738- case 't': mod->second.at_type = modifier::traditional; ++j; return;
739- default : return;
740- }
741- if ( ++j == picture_str.end() )
742- return;
743- if ( *j == '(' ) {
744- while ( true ) {
745- if ( ++j == picture_str.end() )
746+
747+ unicode::code_point cp;
748+ bool got_c, got_o, got_a, got_t;
749+ got_c = got_o = got_a = got_t = false;
750+ utf8_string<zstring const> const u_picture_str( picture_str );
751+ utf8_string<zstring const>::const_iterator u( u_picture_str.current( j ) );
752+
753+ while ( u != u_picture_str.end() ) {
754+ cp = *u++;
755+ switch ( cp ) {
756+ case ']':
757+ return;
758+ case 'c':
759+ if ( got_c )
760+ goto dup_2nd_modifier;
761+ if ( got_o || got_a || got_t )
762+ goto bad_2nd_modifier_here;
763+ got_c = true;
764+ mod->second.co = modifier::cardinal;
765+ parse_variation( u_picture_str, &u, mod, loc );
766+ break;
767+ case 'o':
768+ if ( got_o )
769+ goto dup_2nd_modifier;
770+ if ( got_c || got_a || got_t )
771+ goto bad_2nd_modifier_here;
772+ got_o = true;
773+ mod->second.co = modifier::ordinal;
774+ parse_variation( u_picture_str, &u, mod, loc );
775+ break;
776+ case 'a':
777+ if ( got_a )
778+ goto dup_2nd_modifier;
779+ if ( got_t )
780+ goto bad_2nd_modifier_here;
781+ got_a = true;
782+ mod->second.at = modifier::alphabetic;
783+ break;
784+ case 't':
785+ if ( got_t )
786+ goto dup_2nd_modifier;
787+ if ( got_a )
788+ goto bad_2nd_modifier_here;
789+ got_t = true;
790+ mod->second.at = modifier::traditional;
791+ break;
792+ default:
793 throw XQUERY_EXCEPTION(
794 err::FOFD1340,
795- ERROR_PARAMS( picture_str, ZED( CharExpected_3 ), ')' ),
796+ ERROR_PARAMS(
797+ picture_str,
798+ ZED( FOFD1340_Bad2ndModifier_3 ),
799+ unicode::printable_cp( cp )
800+ ),
801 ERROR_LOC( loc )
802 );
803- if ( *j == ')' )
804- break;
805- mod->second.co_string += *j;
806- }
807- ++j;
808- }
809+ } // switch
810+ } // while
811+ j = u.base();
812+ return;
813+
814+bad_2nd_modifier_here:
815+ throw XQUERY_EXCEPTION(
816+ err::FOFD1340,
817+ ERROR_PARAMS(
818+ picture_str,
819+ ZED( FOFD1340_Bad2ndModifierHere_3 ),
820+ unicode::printable_cp( cp )
821+ )
822+ );
823+
824+dup_2nd_modifier:
825+ throw XQUERY_EXCEPTION(
826+ err::FOFD1340,
827+ ERROR_PARAMS(
828+ picture_str,
829+ ZED( FOFD1340_Dup2ndModifier_3 ),
830+ unicode::printable_cp( cp )
831+ )
832+ );
833 }
834
835 static void parse_width_modifier( zstring const &picture_str,
836@@ -1136,7 +1019,7 @@
837 store::Item_t item;
838 PlanIteratorState *state;
839
840- DEFAULT_STACK_INIT( PlanIteratorState, state, planState);
841+ DEFAULT_STACK_INIT( PlanIteratorState, state, planState );
842
843 if ( !consumeNext( item, theChildren[0].getp(), planState ) ) {
844 // Got the empty sequence -- return same
845@@ -1283,9 +1166,11 @@
846 if ( i == picture_str.end() )
847 goto eos;
848 if ( *i != ']' ) {
849- parse_second_modifier( picture_str, &i, &mod, loc );
850- if ( i == picture_str.end() )
851- goto eos;
852+ if ( *i != ',' && *i != ';' ) {
853+ parse_second_modifier( picture_str, &i, &mod, loc );
854+ if ( i == picture_str.end() )
855+ goto eos;
856+ }
857 parse_width_modifier( picture_str, &i, &mod, loc );
858 if ( i == picture_str.end() )
859 goto eos;
860
861=== renamed file 'src/runtime/numerics/format_integer_impl.cpp' => 'src/runtime/numerics/format_integer.cpp'
862--- src/runtime/numerics/format_integer_impl.cpp 2013-02-28 11:15:32 +0000
863+++ src/runtime/numerics/format_integer.cpp 2013-04-01 03:35:28 +0000
864@@ -1,12 +1,12 @@
865 /*
866 * Copyright 2006-2008 The FLWOR Foundation.
867- *
868+ *
869 * Licensed under the Apache License, Version 2.0 (the "License");
870 * you may not use this file except in compliance with the License.
871 * You may obtain a copy of the License at
872- *
873+ *
874 * http://www.apache.org/licenses/LICENSE-2.0
875- *
876+ *
877 * Unless required by applicable law or agreed to in writing, software
878 * distributed under the License is distributed on an "AS IS" BASIS,
879 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
880@@ -15,962 +15,818 @@
881 */
882 #include "stdafx.h"
883
884+// standard
885+#include <sstream>
886 #include <vector>
887
888-#include <zorba/config.h>
889-
890+// Zorba
891 #include "common/shared_types.h"
892-
893-#include "diagnostics/assert.h"
894+#include "context/dynamic_context.h"
895+#include "context/static_context.h"
896 #include "diagnostics/xquery_diagnostics.h"
897-#include "zorbatypes/zorbatypes_decl.h"
898-#include "zorbatypes/numconversions.h"
899-
900+#include "runtime/core/arithmetic_impl.h"
901+#include "runtime/numerics/numerics.h"
902+#include "runtime/visitors/planiter_visitor.h"
903+#include "store/api/item.h"
904+#include "store/api/item_factory.h"
905 #include "system/globalenv.h"
906-
907 #include "util/ascii_util.h"
908-#include "util/tracer.h"
909+#include "util/stream_util.h"
910 #include "util/unicode_util.h"
911 #include "util/utf8_string.h"
912-
913-#include "types/casting.h"
914-#include "types/typeconstants.h"
915-#include "types/typeops.h"
916-
917-#include "context/static_context.h"
918-
919-// TODO: remove, debugging purposes only
920-#include "context/dynamic_context.h"
921-
922-#include "compiler/api/compilercb.h"
923-
924-#include "runtime/numerics/numerics.h"
925-#include "runtime/visitors/planiter_visitor.h"
926-#include "runtime/core/arithmetic_impl.h"
927-
928-#include "store/api/item_factory.h"
929-#include "store/api/item.h"
930-
931-namespace zorba
932-{
933-
934-xs_integer FormatIntegerIterator::StringToXsInteger(const char *str)
935-{
936- return xs_integer(str);
937-}
938-
939-void FormatIntegerIterator::checkOptionalModifier(utf8_string<zstring> &utf8_picture,
940- unsigned int off,
941- bool *is_ordinal,
942- bool *is_traditional,
943- utf8_string<zstring> &word_terminal)
944-{
945- size_t picture_size = utf8_picture.size();
946- *is_ordinal = false;
947- *is_traditional = false;
948- unsigned int i=0;
949- bool is_ordinal_set = false;
950- bool is_traditional_set = false;
951- utf8_string<zstring>::value_type c;
952- for(i=0;i<2;i++)
953- {
954- if(picture_size <= (off+i))
955- return;
956- c = utf8_picture[off+i];
957- switch(c)
958- {
959- case 'c':
960- if(is_ordinal_set)
961- {
962- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_duplicated_optional_format_modifier), (char)c));
963- }
964- is_ordinal_set = true;
965- *is_ordinal = false;
966- break;
967- case 'o':
968- if(is_ordinal_set)
969- {
970- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_duplicated_optional_format_modifier), (char)c));
971- }
972- is_ordinal_set = true;
973- *is_ordinal = true;
974- break;
975- case 'a':
976- if(is_traditional_set)
977- {
978- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_duplicated_optional_format_modifier), (char)c));
979- }
980- is_traditional_set = true;
981- *is_traditional = false;
982- break;
983- case 't':
984- if(is_traditional_set)
985- {
986- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_duplicated_optional_format_modifier), (char)c));
987- }
988- is_traditional_set = true;
989- *is_traditional = true;
990+#include "zorbatypes/numconversions.h"
991+
992+using namespace std;
993+using namespace zorba::locale;
994+
995+namespace zorba {
996+
997+///////////////////////////////////////////////////////////////////////////////
998+
999+struct picture {
1000+ enum primary_type {
1001+ arabic, // '1' : 0 1 2 ... 10 11 12 ...
1002+ alpha, // 'a' : a b c ... z aa ab ac ...
1003+ ALPHA, // 'A' : A B C ... Z AA AB AC ...
1004+ one, // limited-range integer sequence
1005+ roman, // 'i' : i ii iii iv v vi vii viii ix x ...
1006+ ROMAN, // 'I' : I II III IV V VI VII VIII IX X ...
1007+ words, // 'w' : one two three four ...
1008+ Words, // 'Ww': One Two Three Four ...
1009+ WORDS // 'W' : ONE TWO THREE FOUR ...
1010+ };
1011+
1012+ enum co_type {
1013+ no_co,
1014+ cardinal, // 'c': 7 or seven
1015+ ordinal // 'o': 7th or seventh
1016+ };
1017+
1018+ enum at_type {
1019+ no_at,
1020+ alphabetic, // 'a'
1021+ traditional, // 't'
1022+ };
1023+
1024+ struct {
1025+ primary_type type;
1026+ zstring format;
1027+ int grouping_interval;
1028+ int mandatory_digits;
1029+ int mandatory_grouping_seps;
1030+ unicode::code_point zero, one;
1031+ } primary;
1032+
1033+ struct {
1034+ co_type co;
1035+ zstring co_string;
1036+ at_type at;
1037+ } modifier;
1038+
1039+ //
1040+ // This stuff isn't part of the "presentation modifier" as discussed in the
1041+ // XQuery 3.0 F&O spec, but this is a convenient place to put it nonetheless.
1042+ //
1043+ iso639_1::type lang;
1044+ bool lang_is_fallback;
1045+ iso3166_1::type country;
1046+
1047+ picture() {
1048+ primary.type = arabic;
1049+ primary.grouping_interval = 0;
1050+ primary.mandatory_digits = 0;
1051+ primary.mandatory_grouping_seps = 0;
1052+ primary.zero = '0';
1053+ modifier.co = cardinal;
1054+ modifier.at = no_at;
1055+ }
1056+
1057+ // default picture(picture const&) is fine
1058+ // default picture& operator=(picture const&) is fine
1059+};
1060+
1061+///////////////////////////////////////////////////////////////////////////////
1062+
1063+/**
1064+ * For a code-point of a format token that represents the number 1, gets the
1065+ * range of values said token can be used to format.
1066+ *
1067+ * @param cp The code-point of a format token that represents the number 1.
1068+ * @param min A pointer to an \c int to receive the minimum value of the range.
1069+ * @param max A pointer to an \c int to receive the maximum value of the range.
1070+ */
1071+static bool get_one_range( unicode::code_point cp, int *min, int *max ) {
1072+ using namespace unicode;
1073+ switch ( cp ) {
1074+ case CIRCLED_DIGIT_ONE:
1075+ case DIGIT_ONE_FULL_STOP:
1076+ case DINGBAT_NEGATIVE_CIRCLED_DIGIT_ONE:
1077+ case PARENTHESIZED_DIGIT_ONE:
1078+ *min = 1, *max = 20;
1079+ break;
1080+ case CIRCLED_IDEOGRAPH_ONE:
1081+ case DINGBAT_CIRCLED_SANS_SERIF_DIGIT_ONE:
1082+ case DINGBAT_NEGATIVE_CIRCLED_SANS_SERIF_DIGIT_ONE:
1083+ case DOUBLE_CIRCLED_DIGIT_ONE:
1084+ case PARENTHESIZED_IDEOGRAPH_ONE:
1085+ *min = 1, *max = 10;
1086+ break;
1087+ case ROMAN_NUMERAL_ONE:
1088+ case SMALL_ROMAN_NUMERAL_ONE:
1089+ *min = 1, *max = 12;
1090+ break;
1091+ case SUBSCRIPT_ONE:
1092+ case SUPERSCRIPT_ONE:
1093+ *min = 0, *max = 9;
1094 break;
1095 default:
1096- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_unknown_optional_format_modifier_character), (char)c));
1097- }
1098- }
1099- if(picture_size <= (off+i))
1100- return;
1101- c = utf8_picture[off+i];
1102- if(c != '(')
1103- {
1104- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_unknown_optional_format_modifier_character), (char)c));
1105- }
1106- i++;
1107- bool has_dash = false;
1108- while((off+i) < picture_size)
1109- {
1110- c = utf8_picture[off+i];
1111- if(c == ')')
1112- break;
1113- if(c == '-')
1114- {
1115- if(has_dash)
1116- {
1117- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_unknown_optional_format_modifier_character), (char)c));
1118- }
1119- has_dash = true;
1120- }
1121- else if(has_dash)
1122- word_terminal += c;
1123- i++;
1124- }
1125- if((off+i) >= picture_size)
1126- {
1127- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_optional_format_modifier_not_closed), utf8_picture));
1128- }
1129- i++;
1130- if((off+i) < picture_size)
1131- {
1132- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_unknown_optional_format_modifier_character), (char)utf8_picture[off+i]));
1133- }
1134-}
1135-
1136-/*
1137- represent integer as sequence of letters A, B, ... Z, AA, AB, ....
1138- 'A' is 1
1139- 0 is empty string
1140- The sequence includes the characters 'I' and 'O'
1141- There is no upper limit for the input integer
1142-*/
1143-void FormatIntegerIterator::formatIntegerAZ(xs_integer valueInteger, char c0, zstring &resultString)
1144-{
1145- static const unsigned int letter_range = 'Z' - 'A' + 1;
1146- static xs_integer integer_digit(letter_range);
1147- xs_integer upper_int = valueInteger/integer_digit;
1148- if(upper_int > 0)
1149- formatIntegerAZ(upper_int - 1, c0, resultString);
1150- xs_integer mod_integer = valueInteger % integer_digit;
1151- xs_int mod_int = to_xs_int(mod_integer);
1152- resultString += (c0 + mod_int);
1153-}
1154-
1155-void FormatIntegerIterator::formatIntegerRoman(xs_integer valueInteger, zstring &resultString)
1156-{
1157- static xs_integer integer_3000(3000);
1158- static xs_integer integer_1000(1000);
1159- static xs_integer integer_900(900);
1160- static xs_integer integer_800(800);
1161- static xs_integer integer_700(700);
1162- static xs_integer integer_600(600);
1163- static xs_integer integer_500(500);
1164- static xs_integer integer_400(400);
1165- static xs_integer integer_300(300);
1166- static xs_integer integer_200(200);
1167- static xs_integer integer_100(100);
1168- static xs_integer integer_90(90);
1169- static xs_integer integer_80(80);
1170- static xs_integer integer_70(70);
1171- static xs_integer integer_60(60);
1172- static xs_integer integer_50(50);
1173- static xs_integer integer_40(40);
1174- static xs_integer integer_30(30);
1175- static xs_integer integer_20(20);
1176- static xs_integer integer_10(10);
1177- static xs_integer integer_9(9);
1178- static xs_integer integer_8(8);
1179- static xs_integer integer_7(7);
1180- static xs_integer integer_6(6);
1181- static xs_integer integer_5(5);
1182- static xs_integer integer_4(4);
1183- static xs_integer integer_3(3);
1184- static xs_integer integer_2(2);
1185- static xs_integer integer_1(1);
1186-
1187- if (valueInteger > integer_3000)
1188- {
1189- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_value_gt_3000), valueInteger));
1190- }
1191- else if (valueInteger >= integer_1000)
1192- {
1193- resultString += "M";
1194- formatIntegerRoman(valueInteger - integer_1000, resultString);
1195- }
1196- else if (valueInteger >= integer_900)
1197- {
1198- resultString += "CM";
1199- formatIntegerRoman(valueInteger - integer_900, resultString);
1200- }
1201- else if (valueInteger >= integer_800)
1202- {
1203- resultString += "DCCC";
1204- formatIntegerRoman(valueInteger - integer_800, resultString);
1205- }
1206- else if (valueInteger >= integer_700)
1207- {
1208- resultString += "DCC";
1209- formatIntegerRoman(valueInteger - integer_700, resultString);
1210- }
1211- else if (valueInteger >= integer_600)
1212- {
1213- resultString += "DC";
1214- formatIntegerRoman(valueInteger - integer_600, resultString);
1215- }
1216- else if (valueInteger >= integer_500)
1217- {
1218- resultString += "D";
1219- formatIntegerRoman(valueInteger - integer_500, resultString);
1220- }
1221- else if (valueInteger >= integer_400)
1222- {
1223- resultString += "CD";
1224- formatIntegerRoman(valueInteger - integer_400, resultString);
1225- }
1226- else if (valueInteger >= integer_300)
1227- {
1228- resultString += "CCC";
1229- formatIntegerRoman(valueInteger - integer_300, resultString);
1230- }
1231- else if (valueInteger >= integer_200)
1232- {
1233- resultString += "CC";
1234- formatIntegerRoman(valueInteger - integer_200, resultString);
1235- }
1236- else if (valueInteger >= integer_100)
1237- {
1238- resultString += "C";
1239- formatIntegerRoman(valueInteger - integer_100, resultString);
1240- }
1241- else if (valueInteger >= integer_90)
1242- {
1243- resultString += "XC";
1244- formatIntegerRoman(valueInteger - integer_90, resultString);
1245- }
1246- else if (valueInteger >= integer_80)
1247- {
1248- resultString += "LXXX";
1249- formatIntegerRoman(valueInteger - integer_80, resultString);
1250- }
1251- else if (valueInteger >= integer_70)
1252- {
1253- resultString += "LXX";
1254- formatIntegerRoman(valueInteger - integer_70, resultString);
1255- }
1256- else if (valueInteger >= integer_60)
1257- {
1258- resultString += "LX";
1259- formatIntegerRoman(valueInteger - integer_60, resultString);
1260- }
1261- else if (valueInteger >= integer_50)
1262- {
1263- resultString += "L";
1264- formatIntegerRoman(valueInteger - integer_50, resultString);
1265- }
1266- else if (valueInteger >= integer_40)
1267- {
1268- resultString += "XL";
1269- formatIntegerRoman(valueInteger - integer_40, resultString);
1270- }
1271- else if (valueInteger >= integer_30)
1272- {
1273- resultString += "XXX";
1274- formatIntegerRoman(valueInteger - integer_30, resultString);
1275- }
1276- else if (valueInteger >= integer_20)
1277- {
1278- resultString += "XX";
1279- formatIntegerRoman(valueInteger - integer_20, resultString);
1280- }
1281- else if (valueInteger >= integer_10)
1282- {
1283- resultString += "X";
1284- formatIntegerRoman(valueInteger - integer_10, resultString);
1285- }
1286- else if (valueInteger == integer_9)
1287- {
1288- resultString += "IX";
1289- }
1290- else if (valueInteger == integer_8)
1291- {
1292- resultString += "VIII";
1293- }
1294- else if (valueInteger == integer_7)
1295- {
1296- resultString += "VII";
1297- }
1298- else if (valueInteger == integer_6)
1299- {
1300- resultString += "VI";
1301- }
1302- else if (valueInteger == integer_5)
1303- {
1304- resultString += "V";
1305- }
1306- else if (valueInteger == integer_4)
1307- {
1308- resultString += "IV";
1309- }
1310- else if (valueInteger == integer_3)
1311- {
1312- resultString += "III";
1313- }
1314- else if (valueInteger == integer_2)
1315- {
1316- resultString += "II";
1317- }
1318- else if (valueInteger == integer_1)
1319- {
1320- resultString += "I";
1321- }
1322-}
1323-
1324-void FormatIntegerIterator::formatIntegerEnglish(xs_integer valueInteger, bool is_ordinal, zstring &resultString)
1325-{
1326- //10^303
1327-#ifdef ZORBA_WITH_BIG_INTEGER
1328- static xs_integer integer_centillion = StringToXsInteger("1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
1329- //10^63
1330- static xs_integer integer_vigintillion = StringToXsInteger("1000000000000000000000000000000000000000000000000000000000000000");
1331- //10^60
1332- static xs_integer integer_novemdecillion = StringToXsInteger("1000000000000000000000000000000000000000000000000000000000000");
1333- //10^57
1334- static xs_integer integer_octodecillion = StringToXsInteger("1000000000000000000000000000000000000000000000000000000000");
1335- //10^54
1336- static xs_integer integer_septendecillion =StringToXsInteger("1000000000000000000000000000000000000000000000000000000");
1337- //10^51
1338- static xs_integer integer_sexdecillion = StringToXsInteger("1000000000000000000000000000000000000000000000000000");
1339- //10^48
1340- static xs_integer integer_quindecillion = StringToXsInteger("1000000000000000000000000000000000000000000000000");
1341- //10^45
1342- static xs_integer integer_quattuordecillion=StringToXsInteger("1000000000000000000000000000000000000000000000");
1343- //10^42
1344- static xs_integer integer_tredecillion = StringToXsInteger("1000000000000000000000000000000000000000000");
1345- //10^39
1346- static xs_integer integer_duodecillion = StringToXsInteger("1000000000000000000000000000000000000000");
1347- //10^36
1348- static xs_integer integer_undecillion = StringToXsInteger("1000000000000000000000000000000000000");
1349- //10^33
1350- static xs_integer integer_decillion = StringToXsInteger("1000000000000000000000000000000000");
1351- //10^30
1352- static xs_integer integer_nonillion = StringToXsInteger("1000000000000000000000000000000");
1353- //10^27
1354- static xs_integer integer_octillion = StringToXsInteger("1000000000000000000000000000");
1355- //10^24
1356- static xs_integer integer_septillion = StringToXsInteger("1000000000000000000000000");
1357- //10^21
1358- static xs_integer integer_sextillion = StringToXsInteger("1000000000000000000000");
1359-#endif /* ZORBA_WITH_BIG_INTEGER */
1360- //10^18
1361- static xs_integer integer_quintillion = StringToXsInteger("1000000000000000000");
1362- //10^15
1363- static xs_integer integer_quadrillion = StringToXsInteger("1000000000000000");
1364- //10^12
1365- static xs_integer integer_trillion = StringToXsInteger("1000000000000");
1366- //10^9
1367- static xs_integer integer_billion(1000000000);
1368- //10^6
1369- static xs_integer integer_million(1000000);
1370- //10^3
1371- static xs_integer integer_thousand(1000);
1372- //10^2
1373- static xs_integer integer_hundred(100);
1374- static xs_integer integer_90(90);
1375- static xs_integer integer_80(80);
1376- static xs_integer integer_70(70);
1377- static xs_integer integer_60(60);
1378- static xs_integer integer_50(50);
1379- static xs_integer integer_40(40);
1380- static xs_integer integer_30(30);
1381- static xs_integer integer_20(20);
1382- static xs_integer integer_19(19);
1383- static xs_integer integer_18(18);
1384- static xs_integer integer_17(17);
1385- static xs_integer integer_16(16);
1386- static xs_integer integer_15(15);
1387- static xs_integer integer_14(14);
1388- static xs_integer integer_13(13);
1389- static xs_integer integer_12(12);
1390- static xs_integer integer_11(11);
1391- static xs_integer integer_10(10);
1392- static xs_integer integer_9(9);
1393- static xs_integer integer_8(8);
1394- static xs_integer integer_7(7);
1395- static xs_integer integer_6(6);
1396- static xs_integer integer_5(5);
1397- static xs_integer integer_4(4);
1398- static xs_integer integer_3(3);
1399- static xs_integer integer_2(2);
1400- static xs_integer integer_1(1);
1401-
1402- xs_integer value_mod;
1403-
1404-#define IF_GE(big_number_name) \
1405- else if (valueInteger >= integer_##big_number_name) \
1406- { \
1407- formatIntegerEnglish(valueInteger/integer_##big_number_name, false, resultString); \
1408- resultString += " " #big_number_name; \
1409- value_mod = valueInteger % integer_##big_number_name; \
1410- if(value_mod > 0) \
1411- { \
1412- resultString += " "; \
1413- formatIntegerEnglish(value_mod, is_ordinal, resultString); \
1414- } \
1415- else if(is_ordinal) \
1416- resultString += "th"; \
1417- }
1418-
1419-#define IF_GE_DECIM(decim, decim_cardinal, decim_ordinal) \
1420- else if (valueInteger >= integer_##decim) \
1421- { \
1422- value_mod = valueInteger % integer_##decim; \
1423- if(value_mod > 0) \
1424- { \
1425- resultString += decim_cardinal; \
1426- resultString += "-"; \
1427- formatIntegerEnglish(value_mod, is_ordinal, resultString); \
1428- } \
1429- else if(!is_ordinal) \
1430- resultString += decim_cardinal; \
1431- else \
1432- resultString += decim_ordinal; \
1433- }
1434-
1435- if(0);
1436-#ifdef ZORBA_WITH_BIG_INTEGER
1437- IF_GE(centillion)
1438- IF_GE(vigintillion)
1439- IF_GE(novemdecillion)
1440- IF_GE(octodecillion)
1441- IF_GE(septendecillion)
1442- IF_GE(sexdecillion)
1443- IF_GE(quindecillion)
1444- IF_GE(quattuordecillion)
1445- IF_GE(tredecillion)
1446- IF_GE(duodecillion)
1447- IF_GE(undecillion)
1448- IF_GE(decillion)
1449- IF_GE(nonillion)
1450- IF_GE(octillion)
1451- IF_GE(septillion)
1452- IF_GE(sextillion)
1453-#endif /* ZORBA_WITH_BIG_INTEGER */
1454- IF_GE(quintillion)
1455- IF_GE(quadrillion)
1456- IF_GE(trillion)
1457- IF_GE(billion)
1458- IF_GE(million)
1459- IF_GE(thousand)
1460- IF_GE(hundred)
1461- IF_GE_DECIM(90, "ninety", "ninetieth")
1462- IF_GE_DECIM(80, "eighty", "eightieth")
1463- IF_GE_DECIM(70, "seventy","seventieth")
1464- IF_GE_DECIM(60, "sixty", "sixtieth")
1465- IF_GE_DECIM(50, "fifty", "fiftieth")
1466- IF_GE_DECIM(40, "forty", "fortieth")
1467- IF_GE_DECIM(30, "thirty", "thirtieth")
1468- IF_GE_DECIM(20, "twenty", "twentieth")
1469- IF_GE_DECIM(19, "nineteen", "nineteenth")
1470- IF_GE_DECIM(18, "eighteen", "eighteenth")
1471- IF_GE_DECIM(17, "seventeen", "seventeenth")
1472- IF_GE_DECIM(16, "sixteen", "sixteenth")
1473- IF_GE_DECIM(15, "fifteen", "fifteenth")
1474- IF_GE_DECIM(14, "fourteen", "fourteenth")
1475- IF_GE_DECIM(13, "thirteen", "thirteenth")
1476- IF_GE_DECIM(12, "twelve", "twelfth")
1477- IF_GE_DECIM(11, "eleven", "eleventh")
1478- IF_GE_DECIM(10, "ten", "tenth")
1479- IF_GE_DECIM(9, "nine", "ninth")
1480- IF_GE_DECIM(8, "eight", "eighth")
1481- IF_GE_DECIM(7, "seven", "seventh")
1482- IF_GE_DECIM(6, "six", "sixth")
1483- IF_GE_DECIM(5, "five", "fifth")
1484- IF_GE_DECIM(4, "four", "fourth")
1485- IF_GE_DECIM(3, "three", "third")
1486- IF_GE_DECIM(2, "two", "second")
1487- IF_GE_DECIM(1, "one", "first")
1488- else if (valueInteger == 0)
1489- {
1490- if(!is_ordinal)
1491- resultString += "zero";
1492- else
1493- resultString += "zeroth";
1494- }
1495-}
1496-
1497-bool FormatIntegerIterator::isDecimalDigitPattern(utf8_string<zstring> &utf8_picture,
1498- unsigned int *picture_size,
1499- unsigned int *groupingInterval,
1500- utf8_string<zstring>::value_type *groupingChar,
1501- utf8_string<zstring>::value_type *utf8zero)
1502-{
1503- //first char is either optional digit # or mandatory digit
1504- size_t all_size = utf8_picture.size();
1505- if(all_size == 0)
1506- return false;
1507- *picture_size = all_size;
1508- *groupingInterval = 0;
1509- *utf8zero = 0;
1510- utf8_string<zstring>::value_type prev_groupingChar = 0;
1511- unsigned int prev_grouping_pos = 0;
1512- bool can_have_grouping_interval = true;
1513- utf8_string<zstring>::const_iterator pictureit;
1514- bool is_optional = false;
1515- bool prev_is_grouping = false;
1516- bool has_digits = false;
1517- unsigned int pos;
1518- unicode::code_point zerotemp;
1519- //c = utf8_picture[0];
1520- pictureit = utf8_picture.begin();
1521- if(*pictureit == '#')
1522- is_optional = true;
1523- else if(unicode::is_Nd(*pictureit, &zerotemp))
1524- {
1525- *utf8zero = zerotemp;
1526- has_digits = true;
1527- }
1528- else
1529- return false;
1530- pos = 1;
1531- pictureit++;
1532- while(pos < all_size)
1533- {
1534- if(*pictureit == '#')
1535- {
1536- if(has_digits)
1537- return false;
1538- prev_is_grouping = false;
1539- }
1540- else if(unicode::is_Nd(*pictureit, &zerotemp))
1541- {
1542- if(*utf8zero)
1543- {
1544- if(*utf8zero != zerotemp)
1545- return false;
1546- }
1547- else
1548- *utf8zero = zerotemp;
1549- is_optional = false;
1550- has_digits = true;
1551- prev_is_grouping = false;
1552- }
1553- else if(!is_category(*pictureit, unicode::Nd) &&
1554- !is_category(*pictureit, unicode::Nl) &&
1555- !is_category(*pictureit, unicode::No) &&
1556- !is_category(*pictureit, unicode::Lu) &&
1557- !is_category(*pictureit, unicode::Ll) &&
1558- !is_category(*pictureit, unicode::Lt) &&
1559- !is_category(*pictureit, unicode::Lm) &&
1560- !is_category(*pictureit, unicode::Lo))
1561- {
1562- //is grouping
1563- if(prev_is_grouping)
1564- return false;
1565- prev_is_grouping = true;
1566- if(prev_groupingChar)
1567- {
1568- if(prev_groupingChar == *pictureit)
1569- {
1570- if(*groupingInterval)
1571- {
1572- if((pos - prev_grouping_pos) == *groupingInterval)
1573- prev_grouping_pos = pos;
1574- else
1575- {
1576- *groupingInterval = 0;
1577- can_have_grouping_interval = false;
1578- }
1579- }
1580- else if(can_have_grouping_interval)
1581- {
1582- *groupingInterval = pos - prev_grouping_pos;
1583- if(prev_grouping_pos > *groupingInterval)
1584- {
1585- can_have_grouping_interval = false;
1586- *groupingInterval = 0;
1587- }
1588- else
1589- prev_grouping_pos = pos;
1590- }
1591- }
1592+ return false;
1593+ }
1594+ return true;
1595+}
1596+
1597+static char const* ordinal( xs_integer const &i ) {
1598+ xs_integer a( i );
1599+ if ( a.sign() < 0 )
1600+ a = -a;
1601+ static xs_integer const ten( 10 );
1602+ xs_integer const a_mod_10( a % ten );
1603+ switch ( to_xs_int( a_mod_10 ) ) {
1604+ case 11:
1605+ case 12:
1606+ case 13:
1607+ break;
1608+ default: {
1609+ static xs_integer const hundred( 100 );
1610+ xs_integer const a_mod_100( a % hundred );
1611+ switch ( to_xs_int( a_mod_100 ) ) {
1612+ case 1: return "st";
1613+ case 2: return "nd";
1614+ case 3: return "rd";
1615+ }
1616+ }
1617+ }
1618+ return "th";
1619+}
1620+
1621+static void format_integer( xs_integer const &xs_n, picture const &pic,
1622+ zstring *dest ) {
1623+ picture default_pic;
1624+
1625+ switch ( pic.primary.type ) {
1626+ case picture::one:
1627+ //
1628+ // XQuery F&O 3.0: 4.6.1: For all format tokens other than [ones that
1629+ // consists of decimal digits], there may be implementation-defined lower
1630+ // and upper bounds on the range of numbers that can be formatted using
1631+ // this format token; indeed, for some numbering sequences there may be
1632+ // intrinsic limits. For example, the format token &#x2460; (circled
1633+ // digit one) has a range of 1 to 20 imposed by the Unicode character
1634+ // repertoire.
1635+ //
1636+ try {
1637+ xs_long const n = to_xs_long( xs_n );
1638+ int min, max;
1639+ if ( get_one_range( pic.primary.one, &min, &max ) &&
1640+ n >= min && n <= max ) {
1641+ utf8_string<zstring> u_dest( *dest );
1642+ u_dest = (unicode::code_point)(pic.primary.one + n - 1);
1643+ break;
1644+ }
1645+ //
1646+ // Ibid: Numbers that fall outside this range must be formatted using
1647+ // the format token 1.
1648+ //
1649+ format_integer( xs_n, default_pic, dest );
1650+ }
1651+ catch ( range_error const& ) {
1652+ format_integer( xs_n, default_pic, dest );
1653+ }
1654+ break;
1655+
1656+ case picture::arabic: {
1657+ xs_integer xs_n2( xs_n );
1658+ if ( xs_n2.sign() < 0 )
1659+ xs_n2 = -xs_n2;
1660+
1661+ zstring const s( xs_n2.toString() );
1662+ zstring::const_reverse_iterator n_i( s.rbegin() );
1663+ zstring::const_reverse_iterator const n_end( s.rend() );
1664+
1665+ utf8_string<zstring const> const u_pic_format( pic.primary.format );
1666+ utf8_string<zstring const>::const_reverse_iterator
1667+ pic_i( u_pic_format.rbegin() );
1668+ utf8_string<zstring const>::const_reverse_iterator const
1669+ pic_end( u_pic_format.rend() );
1670+
1671+ int digit_pos = 0;
1672+ unicode::code_point grouping_cp;
1673+ bool just_inserted_grouping_separator = false;
1674+ int mandatory_digits = pic.primary.mandatory_digits;
1675+ int mandatory_grouping_seps = pic.primary.mandatory_grouping_seps;
1676+ utf8_string<zstring> u_dest( *dest );
1677+
1678+ //
1679+ // Step through both the integer and picture from right-to-left.
1680+ //
1681+ while ( n_i != n_end || pic_i != pic_end ) {
1682+ unicode::code_point digit_cp = pic.primary.zero;
1683+ if ( n_i != n_end )
1684+ digit_cp += *n_i - '0';
1685+ if ( pic_i != pic_end ) { // haven't exhausted the picture
1686+ if ( !mandatory_digits && !mandatory_grouping_seps && n_i == n_end )
1687+ break;
1688+ unicode::code_point const pic_cp = *pic_i++;
1689+ bool const is_mandatory_digit = unicode::is_Nd( pic_cp );
1690+ if ( pic_cp == '#' || is_mandatory_digit ) {
1691+ u_dest.insert( 0, 1, digit_cp );
1692+ if ( n_i != n_end ) ++n_i;
1693+ ++digit_pos;
1694+ } else { // must be a grouping-separator
1695+ grouping_cp = pic_cp; // remember for later
1696+ u_dest.insert( 0, 1, grouping_cp );
1697+ --mandatory_grouping_seps;
1698+ }
1699+ if ( is_mandatory_digit )
1700+ --mandatory_digits;
1701+ } else { // have exhausted the picture
1702+ if ( pic.primary.grouping_interval &&
1703+ digit_pos % pic.primary.grouping_interval == 0 ) {
1704+ if ( just_inserted_grouping_separator )
1705+ just_inserted_grouping_separator = false;
1706+ else {
1707+ u_dest.insert( 0, 1, grouping_cp );
1708+ just_inserted_grouping_separator = true;
1709+ continue;
1710+ }
1711+ }
1712+ u_dest.insert( 0, 1, digit_cp );
1713+ if ( n_i != n_end ) ++n_i;
1714+ ++digit_pos;
1715+ }
1716+ } // while
1717+
1718+ if ( xs_n.sign() < 0 )
1719+ dest->insert( (zstring::size_type)0, 1, '-' );
1720+ if ( pic.modifier.co == picture::ordinal )
1721+ *dest += ordinal( xs_n );
1722+ break;
1723+ }
1724+
1725+ case picture::alpha:
1726+ case picture::ALPHA:
1727+ if ( xs_n.sign() == 0 ) {
1728+ //
1729+ // Ibid: Numbers that fall outside this range must be formatted using
1730+ // the format token 1.
1731+ //
1732+ *dest = '0';
1733+ } else
1734+ try {
1735+ xs_long n = to_xs_long( xs_n );
1736+ if ( n < 0 ) {
1737+ *dest = '-';
1738+ n = -n;
1739+ }
1740+ *dest += ztd::alpha( n, pic.primary.type == picture::ALPHA );
1741+ }
1742+ catch ( range_error const& ) {
1743+ format_integer( xs_n, default_pic, dest );
1744+ }
1745+ break;
1746+
1747+ case picture::roman:
1748+ case picture::ROMAN:
1749+ if ( xs_n.sign() == 0 ) {
1750+ //
1751+ // Ibid: Numbers that fall outside this range must be formatted using
1752+ // the format token 1.
1753+ //
1754+ *dest = '0';
1755+ } else
1756+ try {
1757+ xs_long n = to_xs_long( xs_n );
1758+ if ( n < 0 ) {
1759+ *dest = '-';
1760+ n = -n;
1761+ }
1762+ ostringstream oss;
1763+ if ( pic.primary.type == picture::ROMAN )
1764+ oss << uppercase;
1765+ oss << roman( n );
1766+ *dest += oss.str();
1767+ }
1768+ catch ( range_error const& ) {
1769+ format_integer( xs_n, default_pic, dest );
1770+ }
1771+ break;
1772+
1773+ case picture::words:
1774+ try {
1775+ xs_long const n = to_xs_long( xs_n );
1776+ *dest = ztd::english( n, pic.modifier.co == picture::ordinal );
1777+ }
1778+ catch ( range_error const& ) {
1779+ format_integer( xs_n, default_pic, dest );
1780+ }
1781+ break;
1782+
1783+ case picture::Words:
1784+ try {
1785+ xs_long const n = to_xs_long( xs_n );
1786+ *dest = ztd::english( n, pic.modifier.co == picture::ordinal );
1787+ std::transform(
1788+ dest->begin(), dest->end(), dest->begin(), ascii::to_title()
1789+ );
1790+ }
1791+ catch ( range_error const& ) {
1792+ format_integer( xs_n, default_pic, dest );
1793+ }
1794+ break;
1795+
1796+ case picture::WORDS:
1797+ try {
1798+ xs_long const n = to_xs_long( xs_n );
1799+ *dest = ztd::english( n, pic.modifier.co == picture::ordinal );
1800+ ascii::to_upper( *dest );
1801+ }
1802+ catch ( range_error const& ) {
1803+ format_integer( xs_n, default_pic, dest );
1804+ }
1805+ break;
1806+ } // switch
1807+}
1808+
1809+static void parse_primary( zstring const &picture_str,
1810+ zstring::const_iterator *i, picture *pic,
1811+ QueryLoc const &loc ) {
1812+ if ( picture_str.empty() ) {
1813+ //
1814+ // XQuery 3.0 F&O: 4.6.1: The primary format token is always present and
1815+ // must not be zero-length.
1816+ //
1817+empty_format:
1818+ throw XQUERY_EXCEPTION(
1819+ err::FODF1310,
1820+ ERROR_PARAMS( ZED( FODF1310_EmptyFormat ) ),
1821+ ERROR_LOC( loc )
1822+ );
1823+ }
1824+
1825+ //
1826+ // Because of:
1827+ //
1828+ // Ibid: If the string contains one or more semicolons then everything
1829+ // that precedes the last semicolon is taken as the primary format token
1830+ // and everything that follows is taken as the format modifier.
1831+ //
1832+ // we have to count the number of semicolons in order to know when we've
1833+ // reached the last one.
1834+ //
1835+ int semicolon_counter = 0;
1836+ FOR_EACH( zstring, c, picture_str )
1837+ if ( *c == ';' )
1838+ ++semicolon_counter;
1839+ int const semicolons = semicolon_counter;
1840+
1841+ if ( semicolons == 1 && picture_str[0] == ';' ) {
1842+ //
1843+ // This also means that the primary format token is zero-length.
1844+ //
1845+ goto empty_format;
1846+ }
1847+
1848+ unicode::code_point cp;
1849+ utf8_string<zstring const> const u_picture_str( picture_str );
1850+ utf8_string<zstring const>::const_iterator u;
1851+
1852+ //
1853+ // Determine whether the primary format token is a decimal-digit-pattern:
1854+ //
1855+ // Ibid: If the primary format token contains at least one Unicode digit
1856+ // then it is taken as a decimal digit pattern.
1857+ //
1858+ // and whether all digits are from the same digit family:
1859+ //
1860+ // Ibid: All mandatory-digit-signs within the format token must be from
1861+ // the same digit family, where a digit family is a sequence of ten
1862+ // consecutive characters in Unicode category Nd, having digit values 0
1863+ // through 9.
1864+ //
1865+ bool is_decimal_digit_pattern = false;
1866+ unicode::code_point zero[] = { '0', '0' };
1867+ semicolon_counter = semicolons;
1868+ for ( u = u_picture_str.begin(); u != u_picture_str.end(); ++u ) {
1869+ cp = *u;
1870+ if ( cp == ';' && !--semicolon_counter )
1871+ break;
1872+ if ( unicode::is_Nd( cp, &zero[ is_decimal_digit_pattern ] ) ) {
1873+ if ( is_decimal_digit_pattern && zero[1] != zero[0] ) {
1874+ throw XQUERY_EXCEPTION(
1875+ err::FODF1310,
1876+ ERROR_PARAMS(
1877+ picture_str,
1878+ ZED( FODF1310_DigitNotSameFamily_34 ),
1879+ unicode::printable_cp( cp ),
1880+ unicode::printable_cp( zero[0] )
1881+ ),
1882+ ERROR_LOC( loc )
1883+ );
1884+ }
1885+ is_decimal_digit_pattern = true;
1886+ ++pic->primary.mandatory_digits;
1887+ }
1888+ }
1889+
1890+ u = u_picture_str.begin();
1891+ cp = *u;
1892+
1893+ if ( is_decimal_digit_pattern ) {
1894+ if ( cp != '#' && unicode::is_grouping_separator( cp ) ) {
1895+ //
1896+ // Ibid: 4.6.1: A grouping-separator-sign must not appear at the start
1897+ // ... of the decimal-digit-pattern ....
1898+ //
1899+ throw XQUERY_EXCEPTION(
1900+ err::FODF1310,
1901+ ERROR_PARAMS(
1902+ picture_str,
1903+ ZED( FODF1310_NoGroupSepAtStart_3 ),
1904+ unicode::printable_cp( cp )
1905+ ),
1906+ ERROR_LOC( loc )
1907+ );
1908+ }
1909+
1910+ pic->primary.zero = zero[0];
1911+
1912+ utf8_string<zstring> u_pic_format( pic->primary.format );
1913+ u_pic_format += cp;
1914+
1915+ bool got_grouping_separator = false;
1916+ bool got_mandatory_digit = cp != '#';
1917+ int grouping_interval = 0;
1918+ bool grouping_interval_possible = true;
1919+ unicode::code_point grouping_separator_cp = 0;
1920+ int grouping_separators = 0;
1921+ zstring::size_type pos = 0, prev_grouping_pos = zstring::npos;
1922+
1923+ semicolon_counter = semicolons;
1924+ while ( ++u != u_picture_str.end() ) {
1925+ cp = *u, ++pos;
1926+ if ( cp == '#' ) {
1927+ if ( got_mandatory_digit ) {
1928+ //
1929+ // Ibid: There may be zero or more optional-digit-signs, and (if
1930+ // present) these must precede all mandatory-digit-signs.
1931+ //
1932+ throw XQUERY_EXCEPTION(
1933+ err::FODF1310,
1934+ ERROR_PARAMS(
1935+ picture_str,
1936+ ZED( FODF1310_NoOptDigitAfterMandatory )
1937+ ),
1938+ ERROR_LOC( loc )
1939+ );
1940+ }
1941+ got_grouping_separator = false;
1942+ } else if ( unicode::is_Nd( cp ) ) {
1943+ got_mandatory_digit = true;
1944+ got_grouping_separator = false;
1945+ } else if ( unicode::is_grouping_separator( cp ) ) {
1946+ if ( cp == ';' && !--semicolon_counter ) {
1947+ //
1948+ // Ibid: If the string contains one or more semicolons then
1949+ // everything that precedes the last semicolon is taken as the
1950+ // primary format token and everything that follows is taken as the
1951+ // format modifier.
1952+ //
1953+ break;
1954+ }
1955+ if ( got_grouping_separator ) {
1956+ //
1957+ // Ibid: A grouping-separator-sign must not appear ... adjacent to
1958+ // another grouping-separator-sign.
1959+ //
1960+ throw XQUERY_EXCEPTION(
1961+ err::FODF1310,
1962+ ERROR_PARAMS(
1963+ picture_str,
1964+ ZED( FODF1310_NoAdjacentGroupSep_3 ),
1965+ unicode::printable_cp( cp )
1966+ ),
1967+ ERROR_LOC( loc )
1968+ );
1969+ }
1970+ got_grouping_separator = true;
1971+ ++grouping_separators;
1972+
1973+ if ( grouping_interval_possible ) {
1974+ //
1975+ // Ibid: If grouping-separator-signs appear at regular intervals
1976+ // within the format token, that is if the same grouping separator
1977+ // appears at positions forming a sequence N, 2N, 3N, ... for some
1978+ // integer value N (including the case where there is only one number
1979+ // in the list), then the sequence is extrapolated to the left, so
1980+ // grouping separators will be used in the formatted number at every
1981+ // multiple of N. For example, if the format token is 0'000 then the
1982+ // number one million will be formatted as 1'000'000, while the
1983+ // number fifteen will be formatted as 0'015.
1984+ //
1985+ if ( !grouping_separator_cp )
1986+ grouping_separator_cp = cp;
1987+ else if ( cp != grouping_separator_cp )
1988+ grouping_interval_possible = false;
1989+ else if ( !grouping_interval )
1990+ grouping_interval = pos - prev_grouping_pos;
1991+ else if ( pos - prev_grouping_pos != grouping_interval )
1992+ grouping_interval_possible = false;
1993+ prev_grouping_pos = pos;
1994+ }
1995+ } else {
1996+ throw XQUERY_EXCEPTION(
1997+ err::FODF1310,
1998+ ERROR_PARAMS(
1999+ picture_str,
2000+ ZED( FODF1310_BadCharacter_3 ),
2001+ unicode::printable_cp( cp )
2002+ ),
2003+ ERROR_LOC( loc )
2004+ );
2005+ }
2006+ u_pic_format += cp;
2007+ } // while
2008+
2009+ if ( got_grouping_separator ) {
2010+ //
2011+ // Ibid: A grouping-separator-sign must not appear at the ... end of the
2012+ // decimal-digit-pattern ....
2013+ //
2014+ throw XQUERY_EXCEPTION(
2015+ err::FODF1310,
2016+ ERROR_PARAMS(
2017+ picture_str,
2018+ ZED( FODF1310_NoGroupSepAtEnd_3 ),
2019+ unicode::printable_cp( cp )
2020+ ),
2021+ ERROR_LOC( loc )
2022+ );
2023+ }
2024+ if ( grouping_interval_possible ) {
2025+ if ( !grouping_interval && grouping_separator_cp )
2026+ grouping_interval = pos - prev_grouping_pos;
2027+ pic->primary.grouping_interval = grouping_interval;
2028+ } else
2029+ pic->primary.mandatory_grouping_seps = grouping_separators;
2030+
2031+ } else {
2032+
2033+ using namespace unicode;
2034+ ++u;
2035+ switch ( cp ) {
2036+ case 'A':
2037+ pic->primary.type = picture::ALPHA;
2038+ break;
2039+ case 'a':
2040+ pic->primary.type = picture::alpha;
2041+ break;
2042+ case 'I':
2043+ pic->primary.type = picture::ROMAN;
2044+ break;
2045+ case 'i':
2046+ pic->primary.type = picture::roman;
2047+ break;
2048+ case 'W':
2049+ if ( u != u_picture_str.end() && *u == 'w' )
2050+ pic->primary.type = picture::Words, ++u;
2051 else
2052- {
2053- *groupingInterval = 0;
2054- can_have_grouping_interval = false;
2055- }
2056- }
2057- else
2058- {
2059- prev_groupingChar = *pictureit;
2060- prev_grouping_pos = pos;
2061- }
2062- }
2063- else
2064- {
2065- //possibly end of primary token
2066- break;
2067- }
2068- pictureit++;
2069- pos++;
2070- }
2071- if(prev_is_grouping)
2072- return false;
2073- if(!has_digits && !is_optional)
2074- return false;
2075- *picture_size = pos;
2076- if(!*utf8zero)
2077- *utf8zero = '0';//default
2078- if(can_have_grouping_interval && prev_groupingChar)
2079- {
2080- if(*groupingInterval)
2081- {
2082- if(*groupingInterval != (pos - prev_grouping_pos))
2083- *groupingInterval = 0;
2084- }
2085- else
2086- {
2087- *groupingInterval = pos - prev_grouping_pos;
2088- if(prev_grouping_pos > *groupingInterval)
2089- *groupingInterval = 0;
2090- }
2091- }
2092- else
2093- *groupingInterval = 0;
2094- *groupingChar = prev_groupingChar;
2095- return true;
2096+ pic->primary.type = picture::WORDS;
2097+ break;
2098+ case 'w':
2099+ pic->primary.type = picture::words;
2100+ break;
2101+ case CIRCLED_DIGIT_ONE:
2102+ case CIRCLED_IDEOGRAPH_ONE:
2103+ case DIGIT_ONE_FULL_STOP:
2104+ case DINGBAT_CIRCLED_SANS_SERIF_DIGIT_ONE:
2105+ case DINGBAT_NEGATIVE_CIRCLED_DIGIT_ONE:
2106+ case DINGBAT_NEGATIVE_CIRCLED_SANS_SERIF_DIGIT_ONE:
2107+ case DOUBLE_CIRCLED_DIGIT_ONE:
2108+ case PARENTHESIZED_DIGIT_ONE:
2109+ case PARENTHESIZED_IDEOGRAPH_ONE:
2110+ case SUBSCRIPT_ONE:
2111+ case SUPERSCRIPT_ONE:
2112+ pic->primary.type = picture::one;
2113+ pic->primary.one = cp;
2114+ break;
2115+ default:
2116+ //
2117+ // Ibid: If an implementation does not support a numbering sequence
2118+ // represented by the given token, it must use a format token of 1.
2119+ //
2120+ pic->primary.type = picture::arabic;
2121+ pic->primary.format = "1";
2122+
2123+ //
2124+ // Ibid: If the string contains one or more semicolons then
2125+ // everything that precedes the last semicolon is taken as the
2126+ // primary format token and everything that follows is taken as the
2127+ // format modifier.
2128+ //
2129+ // Hence, we have to skip everything up to (but not including) the last
2130+ // semicolon (if any).
2131+ //
2132+ semicolon_counter = semicolons;
2133+ for ( ; u != u_picture_str.end(); ++u )
2134+ if ( *u == ';' && !--semicolon_counter )
2135+ break;
2136+ } // switch
2137+ }
2138+ *i = u.base();
2139 }
2140
2141-void FormatIntegerIterator::formatIntegerDecimalPattern(zstring::const_reverse_iterator valueit,
2142- zstring::const_reverse_iterator &valueit_rend,
2143- std::vector<unicode::code_point>::const_reverse_iterator pictureit,
2144- std::vector<unicode::code_point>::const_reverse_iterator &pictureit_rend,
2145- unsigned int picture_pos,
2146- unsigned int grouping_interval,
2147- utf8_string<zstring>::value_type grouping_char,
2148- utf8_string<zstring>::value_type utf8zero,
2149- utf8_string<zstring> &utf8_result)
2150-{
2151- if(valueit == valueit_rend)
2152- {
2153- if((pictureit == pictureit_rend) || (*pictureit == '#'))
2154- return;
2155- }
2156- if(grouping_interval && !((picture_pos+1)%grouping_interval))
2157- {
2158- if((pictureit != pictureit_rend) && (*pictureit == grouping_char))
2159- {
2160- pictureit++;//ignore it automatically
2161- if(valueit == valueit_rend)
2162- {
2163- if((pictureit == pictureit_rend) || (*pictureit == '#'))
2164- return;
2165- }
2166- }
2167- formatIntegerDecimalPattern(valueit, valueit_rend, pictureit, pictureit_rend, picture_pos+1, grouping_interval, grouping_char, utf8zero, utf8_result);
2168- utf8_result += (grouping_char);
2169+static void parse_variation( utf8_string<zstring const> const &u_picture_str,
2170+ utf8_string<zstring const>::const_iterator *u,
2171+ picture *pic, QueryLoc const &loc ) {
2172+ utf8_string<zstring const>::const_iterator &v = *u;
2173+ if ( v == u_picture_str.end() )
2174 return;
2175- }
2176-
2177- if(valueit == valueit_rend)
2178- {
2179- if(unicode::is_category(*pictureit, unicode::Nd))
2180- {
2181- formatIntegerDecimalPattern(valueit, valueit_rend, pictureit+1, pictureit_rend, picture_pos+1, grouping_interval, grouping_char, utf8zero, utf8_result);
2182- utf8_result += (utf8zero);
2183- return;
2184- }
2185- else
2186- return;//it is grouping char
2187- }
2188- else
2189- {
2190- if(pictureit != pictureit_rend)
2191- {
2192- if(*pictureit == '#' || unicode::is_category(*pictureit, unicode::Nd))
2193- {
2194- formatIntegerDecimalPattern(valueit+1, valueit_rend, pictureit+1, pictureit_rend, picture_pos+1, grouping_interval, grouping_char, utf8zero, utf8_result);
2195- utf8_result += (utf8zero + *valueit - '0');
2196- return;
2197- }
2198- else
2199- {
2200- formatIntegerDecimalPattern(valueit, valueit_rend, pictureit+1, pictureit_rend, picture_pos+1, grouping_interval, grouping_char, utf8zero, utf8_result);
2201- utf8_result += (*pictureit);
2202- return;
2203- }
2204- }
2205- else
2206- {
2207- formatIntegerDecimalPattern(valueit+1, valueit_rend, pictureit, pictureit_rend, picture_pos+1, grouping_interval, grouping_char, utf8zero, utf8_result);
2208- utf8_result += (utf8zero + *valueit - '0');
2209- return;
2210- }
2211- }
2212-}
2213-
2214-void FormatIntegerIterator::addOrdinalEnglish(zstring &valueString,
2215- unsigned int valuelen,
2216- utf8_string<zstring> &utf8_result)
2217-{
2218- if((valuelen >= 2) && (valueString[valuelen - 2] == '1'))
2219- {
2220- utf8_result += "th";
2221- }
2222- else if(valueString[valuelen-1] == '1')
2223- {
2224- utf8_result += "st";
2225- }
2226- else if(valueString[valuelen-1] == '2')
2227- {
2228- utf8_result += "nd";
2229- }
2230- else if(valueString[valuelen-1] == '3')
2231- {
2232- utf8_result += "rd";
2233- }
2234- else
2235- {
2236- utf8_result += "th";
2237- }
2238-}
2239-
2240-bool
2241-FormatIntegerIterator::nextImpl(store::Item_t& result, PlanState& planState) const
2242-{
2243- store::Item_t value_item;
2244- store::Item_t picture_item;
2245- store::Item_t language_item;
2246- zstring resultString;
2247- utf8_string<zstring> utf8_result(resultString);
2248- zstring languageString;
2249- zstring pictureString;
2250- utf8_string<zstring> utf8_picture(pictureString);
2251- xs_integer valueInteger;
2252- bool is_neg = false;
2253- TypeManager* tm = theSctx->get_typemanager();
2254- const RootTypeManager& rtm = GENV_TYPESYSTEM;
2255-
2256- PlanIteratorState* state;
2257- DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
2258-
2259- if (consumeNext(value_item, theChildren[0].getp(), planState))
2260- {
2261- valueInteger = value_item->getIntegerValue();
2262- if(valueInteger < 0)
2263- {
2264- valueInteger = -valueInteger;
2265- is_neg = true;
2266- }
2267-
2268- consumeNext(picture_item, theChildren[1].getp(), planState);
2269- pictureString = picture_item->getStringValue();
2270- if(utf8_picture.size() == 0)
2271- {
2272- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_picture_empty)), ERROR_LOC(loc));
2273- }
2274-
2275- if (theChildren.size() == 3)
2276- {
2277- consumeNext(language_item, theChildren[2].getp(), planState);
2278- languageString = language_item->getStringValue();
2279-
2280- if(!GenericCast::isCastable(languageString, &*rtm.LANGUAGE_TYPE_ONE, tm))
2281- {
2282- throw XQUERY_EXCEPTION(err::FOFI0001,
2283- ERROR_PARAMS(languageString), ERROR_LOC(loc));
2284- }
2285- }
2286-
2287- try
2288- {
2289- bool is_ordinal = false;
2290- bool is_traditional = false;
2291- unsigned int picture_size = 0;
2292- unsigned int grouping_interval = 0;
2293- utf8_string<zstring>::value_type grouping_char;
2294- utf8_string<zstring>::value_type c0;
2295- utf8_string<zstring>::value_type utf8zero;
2296- zstring word_terminal;
2297- utf8_string<zstring> utf8_word_terminal(word_terminal);
2298- c0 = utf8_picture[0];
2299-
2300- if((c0 == 'a') || (c0 == 'A'))
2301- {
2302- checkOptionalModifier(utf8_picture, 1, &is_ordinal, &is_traditional, utf8_word_terminal);
2303- if(valueInteger > 0)
2304- {
2305- if(is_neg)
2306- resultString += '-';
2307- formatIntegerAZ(valueInteger-1, c0, resultString);
2308- }
2309- }
2310- else if((c0 == 'i') || (c0 == 'I'))
2311- {
2312- checkOptionalModifier(utf8_picture, 1, &is_ordinal, &is_traditional, utf8_word_terminal);
2313- if(valueInteger > 0)
2314- {
2315- if(is_neg)
2316- resultString += ("-");
2317- formatIntegerRoman(valueInteger, resultString);
2318- if(c0 == 'i')
2319- ascii::to_lower(resultString);
2320- }
2321- }
2322- else if((c0 == 'w') || (c0 == 'W'))
2323- {
2324- utf8_string<zstring>::value_type c1 = 0;
2325- bool title_case = false;
2326- if(utf8_picture.size() > 1)
2327- {
2328- c1 = utf8_picture[1];
2329- if((c0 == 'W') && (c1 == 'w'))
2330- {
2331- title_case = true;
2332- checkOptionalModifier(utf8_picture, 2, &is_ordinal, &is_traditional, utf8_word_terminal);
2333- }
2334- else
2335- checkOptionalModifier(utf8_picture, 1, &is_ordinal, &is_traditional, utf8_word_terminal);
2336- }
2337- //only english for now
2338- if(is_neg)
2339- resultString = "minus ";
2340- formatIntegerEnglish(valueInteger, is_ordinal, resultString);
2341- if(c0 == 'W')
2342- {
2343- if(!title_case)
2344- ascii::to_upper(resultString);
2345- else if(resultString[0] != '-')
2346- {
2347- char cup[2];
2348- cup[0] = ascii::to_upper(resultString[0]);
2349- cup[1] = 0;
2350- resultString.replace(0, 1, cup);
2351- }
2352- else
2353- {
2354- char cup[2];
2355- cup[0] = ascii::to_upper(resultString[1]);
2356- cup[1] = 0;
2357- resultString.replace(1, 1, cup);
2358- }
2359- }
2360- }
2361- else if(c0 == 0x2081) //SUBSCRIPT ONE (decimal, 0-9)
2362- {
2363- checkOptionalModifier(utf8_picture, 1, &is_ordinal, &is_traditional, utf8_word_terminal);
2364- zstring valueString = valueInteger.toString();
2365- zstring::iterator valueit;
2366- for(valueit = valueString.begin(); valueit != valueString.end(); valueit++)
2367- {
2368- if(!isdigit(*valueit))
2369- {
2370- utf8_result += (*valueit);
2371- }
2372- else
2373- utf8_result += (unicode::code_point)(0x2080 + *valueit - '0');
2374- }
2375- }
2376- else if((c0 == 0x2460) || //CIRCLED DIGIT ONE (1-20)
2377- (c0 == 0x2474) || //PARENTHESIZED DIGIT ONE (1-20)
2378- (c0 == 0x2488)) //DIGIT ONE FULL STOP (1-20)
2379- {
2380- checkOptionalModifier(utf8_picture, 1, &is_ordinal, &is_traditional, utf8_word_terminal);
2381- xs_int val_int = to_xs_int(valueInteger);
2382- if((val_int < 1) || (val_int > 20))
2383- {
2384- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_value_1_20), val_int), ERROR_LOC(loc));
2385- }
2386- utf8_result += (c0 + val_int - 1);
2387- }
2388- else if((c0 == 0x1369) || //ETHIOPIC DIGIT ONE (1-10)
2389- (c0 == 0x24F5) || //DOUBLE CIRCLED DIGIT ONE (1-10)
2390- (c0 == 0x2776) || //DINGBAT NEGATIVE CIRCLED DIGIT ONE (1-10)
2391- (c0 == 0x2780) || //DINGBAT CIRCLED SANS-SERIF DIGIT ONE (1-10)
2392- (c0 == 0x278A) || //DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE (1-10)
2393- (c0 == 0x3220) || //PARENTHESIZED IDEOGRAPH ONE (1-10)
2394- (c0 == 0x3280) || //CIRCLED IDEOGRAPH ONE (1-10)
2395- (c0 == 0x10107) || //AEGEAN NUMBER ONE (1-10)
2396- (c0 == 0x10E60) || //RUMI DIGIT ONE (1-10)
2397- (c0 == 0x11052) || //BRAHMI NUMBER ONE (1-10)
2398- (c0 == 0x1D360)) //COUNTING ROD UNIT DIGIT ONE (1-10)
2399- {
2400- checkOptionalModifier(utf8_picture, 1, &is_ordinal, &is_traditional, utf8_word_terminal);
2401- xs_int val_int = to_xs_int(valueInteger);
2402- if((val_int < 1) || (val_int > 10))
2403- {
2404- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_value_1_10), val_int), ERROR_LOC(loc));
2405- }
2406- utf8_result += (c0 + val_int - 1);
2407- }
2408- else if(isDecimalDigitPattern(utf8_picture, &picture_size, &grouping_interval, &grouping_char, &utf8zero))
2409- {
2410- checkOptionalModifier(utf8_picture, picture_size, &is_ordinal, &is_traditional, utf8_word_terminal);
2411-
2412- zstring valueString = valueInteger.toString();
2413- zstring::const_reverse_iterator valueit = valueString.rbegin();
2414- zstring::const_reverse_iterator valueit_rend = valueString.rend();
2415- utf8_string<zstring>::const_iterator pictureit;
2416- std::vector<unicode::code_point> picture_cp;
2417- for(pictureit = utf8_picture.begin(); pictureit != utf8_picture.end();pictureit++)
2418- {
2419- picture_cp.push_back(*pictureit);
2420- }
2421- std::vector<unicode::code_point>::const_reverse_iterator picture_cp_rbegin = picture_cp.rbegin();
2422- std::vector<unicode::code_point>::const_reverse_iterator picture_cp_rend = picture_cp.rend();
2423- picture_cp_rbegin += (utf8_picture.length() - picture_size);
2424- if(is_neg)
2425- utf8_result += ("-");
2426- formatIntegerDecimalPattern(valueit, valueit_rend,
2427- picture_cp_rbegin, picture_cp_rend,
2428- 0,
2429- grouping_interval, grouping_char,
2430- utf8zero,
2431- utf8_result);
2432- unsigned int valuelen = valueString.length();
2433- if(is_ordinal && (utf8zero == '0') && (valuelen >= 1))
2434- {
2435- addOrdinalEnglish(valueString, valuelen, utf8_result);
2436- }
2437- }
2438- else
2439- {
2440- throw XQUERY_EXCEPTION(err::FOFI0002, ERROR_PARAMS(ZED(format_integer_bad_picture_format), pictureString), ERROR_LOC(loc));
2441- }
2442- }
2443- catch (ZorbaException& e)
2444- {
2445- set_source(e, loc);
2446- throw;
2447- }
2448- catch (std::range_error const&re)
2449- {
2450- //"FOCA0003", "\"$1\": value too large for integer"
2451- throw XQUERY_EXCEPTION(err::FOCA0003, ERROR_PARAMS(re.what()), ERROR_LOC(loc));
2452- }
2453- STACK_PUSH (GENV_ITEMFACTORY->createString(result, resultString), state);
2454-
2455- }
2456- else
2457- {
2458- STACK_PUSH (GENV_ITEMFACTORY->createString(result, resultString), state);
2459- }
2460- STACK_END (state);
2461-}
2462+ if ( *v == '(' ) {
2463+ //
2464+ // XQuery F&O 3.0 4.6.1: The string of characters between the parentheses,
2465+ // if present, is used to select between other possible variations of
2466+ // cardinal or ordinal numbering sequences. The interpretation of this
2467+ // string is implementation-defined. No error occurs if the implementation
2468+ // does not define any interpretation for the defined string.
2469+ //
2470+ utf8_string<zstring> u_pic_co_string( pic->modifier.co_string );
2471+ while ( true ) {
2472+ if ( ++v == u_picture_str.end() )
2473+ throw XQUERY_EXCEPTION(
2474+ err::FODF1310,
2475+ ERROR_PARAMS( *u_picture_str.get(), ZED( CharExpected_3 ), ')' ),
2476+ ERROR_LOC( loc )
2477+ );
2478+ unicode::code_point const cp = *v;
2479+ if ( cp == ')' )
2480+ break;
2481+ u_pic_co_string += cp;
2482+ }
2483+ ++v;
2484+ }
2485+}
2486+
2487+static void parse_format_modifier( zstring const &picture_str,
2488+ zstring::const_iterator *i, picture *pic,
2489+ QueryLoc const &loc ) {
2490+ utf8_string<zstring const> const u_picture_str( picture_str );
2491+ utf8_string<zstring const>::const_iterator u( u_picture_str.current( *i ) );
2492+
2493+ unicode::code_point cp = *u++;
2494+ if ( cp != ';' )
2495+ goto bad_format_modifier;
2496+
2497+ bool got_c, got_o, got_a, got_t;
2498+ got_c = got_o = got_a = got_t = false;
2499+
2500+ while ( u != u_picture_str.end() ) {
2501+ cp = *u++;
2502+ switch ( cp ) {
2503+ case 'c':
2504+ if ( got_c )
2505+ goto dup_format_modifier;
2506+ if ( got_o || got_a || got_t )
2507+ goto bad_format_modifier_here;
2508+ got_c = true;
2509+ pic->modifier.co = picture::cardinal;
2510+ parse_variation( u_picture_str, &u, pic, loc );
2511+ break;
2512+ case 'o':
2513+ if ( got_o )
2514+ goto dup_format_modifier;
2515+ if ( got_c || got_a || got_t )
2516+ goto bad_format_modifier_here;
2517+ got_o = true;
2518+ pic->modifier.co = picture::ordinal;
2519+ parse_variation( u_picture_str, &u, pic, loc );
2520+ break;
2521+ case 'a':
2522+ if ( got_a )
2523+ goto dup_format_modifier;
2524+ if ( got_t )
2525+ goto bad_format_modifier_here;
2526+ got_a = true;
2527+ pic->modifier.at = picture::alphabetic;
2528+ break;
2529+ case 't':
2530+ if ( got_t )
2531+ goto dup_format_modifier;
2532+ if ( got_a )
2533+ goto bad_format_modifier_here;
2534+ got_t = true;
2535+ pic->modifier.at = picture::traditional;
2536+ break;
2537+ default:
2538+ goto bad_format_modifier;
2539+ } // switch
2540+ } // while
2541+ *i = u.base();
2542+ return;
2543+
2544+bad_format_modifier:
2545+ throw XQUERY_EXCEPTION(
2546+ err::FODF1310,
2547+ ERROR_PARAMS(
2548+ picture_str,
2549+ ZED( FODF1310_BadFormatModifier_3 ),
2550+ unicode::printable_cp( cp )
2551+ ),
2552+ ERROR_LOC( loc )
2553+ );
2554+
2555+bad_format_modifier_here:
2556+ throw XQUERY_EXCEPTION(
2557+ err::FODF1310,
2558+ ERROR_PARAMS(
2559+ picture_str,
2560+ ZED( FODF1310_BadFormatModifierHere_3 ),
2561+ unicode::printable_cp( cp )
2562+ )
2563+ );
2564+
2565+dup_format_modifier:
2566+ throw XQUERY_EXCEPTION(
2567+ err::FODF1310,
2568+ ERROR_PARAMS(
2569+ picture_str,
2570+ ZED( FODF1310_DupFormatModifier_3 ),
2571+ unicode::printable_cp( cp )
2572+ )
2573+ );
2574+}
2575+
2576+bool FormatIntegerIterator::nextImpl( store::Item_t &result,
2577+ PlanState &planState ) const {
2578+ store::Item_t item;
2579+ iso639_1::type lang = iso639_1::unknown;
2580+ iso3166_1::type country = iso3166_1::unknown;
2581+ bool lang_is_fallback = false;
2582+ picture pic;
2583+ zstring::const_iterator pic_i;
2584+ zstring picture_str, result_str;
2585+ xs_integer value;
2586+ PlanIteratorState *state;
2587+
2588+ DEFAULT_STACK_INIT( PlanIteratorState, state, planState );
2589+
2590+ if ( consumeNext( item, theChildren[0].getp(), planState ) ) {
2591+ value = item->getIntegerValue();
2592+ consumeNext( item, theChildren[1].getp(), planState );
2593+ item->getStringValue2( picture_str );
2594+
2595+ if ( theChildren.size() > 2 ) {
2596+ consumeNext( item, theChildren[2].getp(), planState );
2597+ if ( !locale::parse( item->getStringValue(), &lang, &country ) ||
2598+ !locale::is_supported( lang, country ) ) {
2599+ lang = iso639_1::unknown;
2600+ pic.lang_is_fallback = true;
2601+ }
2602+ }
2603+
2604+ if ( !lang ) {
2605+ //
2606+ // XQuery 3.0 F&O: 4.6.1: If the $lang argument is absent, or is set to
2607+ // an empty sequence, or is invalid, or is not a language supported by
2608+ // the implementation, then the number is formatted using the default
2609+ // language from the dynamic context.
2610+ //
2611+ planState.theLocalDynCtx->get_locale( &lang, &country );
2612+ if ( !locale::is_supported( lang, country ) ) {
2613+ //
2614+ // If the language defined in the dynamic context isn't supported
2615+ // either, try the host's language and hope for the best.
2616+ //
2617+ lang = locale::get_host_lang();
2618+ country = locale::get_host_country();
2619+ pic.lang_is_fallback = true;
2620+ }
2621+ }
2622+
2623+ pic.lang = lang;
2624+ pic.country = country;
2625+
2626+ pic_i = picture_str.begin();
2627+ parse_primary( picture_str, &pic_i, &pic, loc );
2628+ if ( pic_i != picture_str.end() )
2629+ parse_format_modifier( picture_str, &pic_i, &pic, loc );
2630+
2631+ format_integer( value, pic, &result_str );
2632+ }
2633+ STACK_PUSH( GENV_ITEMFACTORY->createString( result, result_str ), state );
2634+ STACK_END( state );
2635+}
2636+
2637+///////////////////////////////////////////////////////////////////////////////
2638
2639 } // namespace zorba
2640 /* vim:set et sw=2 ts=2: */
2641
2642=== modified file 'src/runtime/numerics/pregenerated/numerics.h'
2643--- src/runtime/numerics/pregenerated/numerics.h 2013-03-05 23:11:50 +0000
2644+++ src/runtime/numerics/pregenerated/numerics.h 2013-04-01 03:35:28 +0000
2645@@ -238,15 +238,6 @@
2646
2647 virtual ~FormatIntegerIterator();
2648
2649-public:
2650- static xs_integer StringToXsInteger(const char * str);
2651- static void checkOptionalModifier(utf8_string<zstring> & utf8_picture, unsigned int off, bool * is_ordinal, bool * is_traditional, utf8_string<zstring> & word_terminal);
2652- static void formatIntegerAZ(xs_integer valueInteger, char c0, zstring & resultString);
2653- static void formatIntegerRoman(xs_integer valueInteger, zstring & resultString);
2654- static void formatIntegerEnglish(xs_integer valueInteger, bool is_ordinal, zstring & resultString);
2655- static bool isDecimalDigitPattern(utf8_string<zstring> & utf8_picture, unsigned int * picture_size, unsigned int * groupingInterval, utf8_string<zstring>::value_type * groupingChar, utf8_string<zstring>::value_type * utf8zero);
2656- static void formatIntegerDecimalPattern(zstring::const_reverse_iterator valueit, zstring::const_reverse_iterator & valueit_rend, std::vector<unicode::code_point>::const_reverse_iterator pictureit, std::vector<unicode::code_point>::const_reverse_iterator & pictureit_rend, unsigned int picture_pos, unsigned int grouping_interval, utf8_string<zstring>::value_type grouping_char, utf8_string<zstring>::value_type utf8zero, utf8_string<zstring> & utf8_result);
2657- static void addOrdinalEnglish(zstring & valueString, unsigned int valuelen, utf8_string<zstring> & utf8_result);
2658 void accept(PlanIterVisitor& v) const;
2659
2660 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
2661
2662=== modified file 'src/runtime/spec/numerics/numerics.xml'
2663--- src/runtime/spec/numerics/numerics.xml 2013-03-04 21:00:58 +0000
2664+++ src/runtime/spec/numerics/numerics.xml 2013-04-01 03:35:28 +0000
2665@@ -146,9 +146,7 @@
2666 ********************************************************************************/
2667 -->
2668 <zorba:iterator name="FormatIntegerIterator">
2669-
2670 <zorba:description author="Zorba Team">fn:format-integer</zorba:description>
2671-
2672 <zorba:function>
2673 <zorba:signature localname="format-integer" prefix="fn" version="3.0">
2674 <zorba:param>xs:integer?</zorba:param>
2675@@ -162,72 +160,8 @@
2676 <zorba:output>xs:string</zorba:output>
2677 </zorba:signature>
2678 </zorba:function>
2679-
2680- <zorba:method name="StringToXsInteger"
2681- return="static xs_integer">
2682- <zorba:param type="const char *" name="str"/>
2683- </zorba:method>
2684-
2685- <zorba:method name="checkOptionalModifier"
2686- return="static void">
2687- <zorba:param type="utf8_string&lt;zstring&gt; &amp;" name="utf8_picture"/>
2688- <zorba:param type="unsigned int" name="off"/>
2689- <zorba:param type="bool *" name="is_ordinal"/>
2690- <zorba:param type="bool *" name="is_traditional"/>
2691- <zorba:param type="utf8_string&lt;zstring&gt; &amp;" name="word_terminal"/>
2692- </zorba:method>
2693-
2694- <zorba:method name="formatIntegerAZ"
2695- return="static void">
2696- <zorba:param type="xs_integer" name="valueInteger"/>
2697- <zorba:param type="char" name="c0"/>
2698- <zorba:param type="zstring &amp;" name="resultString"/>
2699- </zorba:method>
2700-
2701- <zorba:method name="formatIntegerRoman"
2702- return="static void">
2703- <zorba:param type="xs_integer" name="valueInteger"/>
2704- <zorba:param type="zstring &amp;" name="resultString"/>
2705- </zorba:method>
2706-
2707- <zorba:method name="formatIntegerEnglish"
2708- return="static void">
2709- <zorba:param type="xs_integer" name="valueInteger"/>
2710- <zorba:param type="bool" name="is_ordinal"/>
2711- <zorba:param type="zstring &amp;" name="resultString"/>
2712- </zorba:method>
2713-
2714- <zorba:method name="isDecimalDigitPattern"
2715- return="static bool">
2716- <zorba:param type="utf8_string&lt;zstring&gt; &amp;" name="utf8_picture"/>
2717- <zorba:param type="unsigned int *" name="picture_size"/>
2718- <zorba:param type="unsigned int *" name="groupingInterval"/>
2719- <zorba:param type="utf8_string&lt;zstring&gt;::value_type *" name="groupingChar"/>
2720- <zorba:param type="utf8_string&lt;zstring&gt;::value_type *" name="utf8zero"/>
2721- </zorba:method>
2722-
2723- <zorba:method name="formatIntegerDecimalPattern"
2724- return="static void">
2725- <zorba:param type="zstring::const_reverse_iterator" name="valueit"/>
2726- <zorba:param type="zstring::const_reverse_iterator &amp;" name="valueit_rend"/>
2727- <zorba:param type="std::vector&lt;unicode::code_point&gt;::const_reverse_iterator" name="pictureit"/>
2728- <zorba:param type="std::vector&lt;unicode::code_point&gt;::const_reverse_iterator &amp;" name="pictureit_rend"/>
2729- <zorba:param type="unsigned int" name="picture_pos"/>
2730- <zorba:param type="unsigned int" name="grouping_interval"/>
2731- <zorba:param type="utf8_string&lt;zstring&gt;::value_type" name="grouping_char"/>
2732- <zorba:param type="utf8_string&lt;zstring&gt;::value_type" name="utf8zero"/>
2733- <zorba:param type="utf8_string&lt;zstring&gt; &amp;" name="utf8_result"/>
2734- </zorba:method>
2735-
2736- <zorba:method name="addOrdinalEnglish"
2737- return="static void">
2738- <zorba:param type="zstring &amp;" name="valueString"/>
2739- <zorba:param type="unsigned int" name="valuelen"/>
2740- <zorba:param type="utf8_string&lt;zstring&gt; &amp;" name="utf8_result"/>
2741- </zorba:method>
2742-
2743 </zorba:iterator>
2744
2745- </zorba:iterators>
2746-
2747-
2748+</zorba:iterators>
2749+
2750+<!-- vim:set et sw=2 ts=2: -->
2751
2752=== modified file 'src/util/ascii_util.h'
2753--- src/util/ascii_util.h 2013-03-21 00:54:36 +0000
2754+++ src/util/ascii_util.h 2013-04-01 03:35:28 +0000
2755@@ -22,6 +22,7 @@
2756 #include <cctype>
2757 #include <cstddef>
2758 #include <cstring>
2759+#include <functional>
2760 #include <iterator>
2761
2762 // local
2763@@ -589,6 +590,29 @@
2764 );
2765 }
2766
2767+/**
2768+ * A unary_function to convert a (presumed) lower-case string to title-case
2769+ * "Like This."
2770+ */
2771+class to_title : public std::unary_function<char,char> {
2772+public:
2773+ to_title() : capitalize_( true ) { }
2774+
2775+ result_type operator()( argument_type c ) {
2776+ if ( is_alpha( c ) ) {
2777+ if ( capitalize_ ) {
2778+ c = to_upper( c );
2779+ capitalize_ = false;
2780+ }
2781+ } else if ( is_space( c ) )
2782+ capitalize_ = true;
2783+ return c;
2784+ };
2785+
2786+private:
2787+ bool capitalize_;
2788+};
2789+
2790 ////////// Replacement ////////////////////////////////////////////////////////
2791
2792 /**
2793
2794=== modified file 'src/util/string_util.cpp'
2795--- src/util/string_util.cpp 2013-03-11 21:58:20 +0000
2796+++ src/util/string_util.cpp 2013-04-01 03:35:28 +0000
2797@@ -170,6 +170,141 @@
2798
2799 ///////////////////////////////////////////////////////////////////////////////
2800
2801+zstring alpha( unsigned long long n, bool capital ) {
2802+ if ( !n )
2803+ return "0";
2804+ zstring result;
2805+ char const c = capital ? 'A' : 'a';
2806+ while ( n ) {
2807+ unsigned long long const m = n - 1;
2808+ result.insert( (zstring::size_type)0, 1, c + m % 26 );
2809+ n = m / 26;
2810+ }
2811+ return result;
2812+}
2813+
2814+namespace english_impl {
2815+
2816+// Based on code from:
2817+// http://www.cprogramming.com/challenges/integer-to-english-sol.html
2818+
2819+static zstring const ones[][2] = {
2820+ { "", "" },
2821+ { "one", "first" },
2822+ { "two", "second" },
2823+ { "three", "third" },
2824+ { "four", "fourth" },
2825+ { "five", "fifth" },
2826+ { "six", "sixth" },
2827+ { "seven", "seventh" },
2828+ { "eight", "eighth" },
2829+ { "nine", "ninth" },
2830+ { "ten", "tenth" },
2831+ { "eleven", "eleventh" },
2832+ { "twelve", "twelfth" },
2833+ { "thirteen", "thirteenth" },
2834+ { "fourteen", "fourteenth" },
2835+ { "fifteen", "fifteenth" },
2836+ { "sixteen", "sixteenth" },
2837+ { "seventeen", "seventeenth" },
2838+ { "eighteen", "eighteenth" },
2839+ { "nineteen", "nineteenth" }
2840+};
2841+
2842+static zstring const tens[][2] = {
2843+ { "", "" },
2844+ { "", "" },
2845+ { "twenty", "twentieth" },
2846+ { "thirty", "thirtieth" },
2847+ { "forty", "fortieth" },
2848+ { "fifty", "fiftieth" },
2849+ { "sixty", "sixtieth" },
2850+ { "seventy", "seventieth" },
2851+ { "eighty", "eighteenth" },
2852+ { "ninety", "ninetieth" }
2853+};
2854+
2855+// Enough entries to print English for 64-bit integers.
2856+static zstring const big[][2] = {
2857+ { "", "" },
2858+ { "thousand", "thousandth" },
2859+ { "million", "millionth" },
2860+ { "billion", "billionth" },
2861+ { "trillion", "trillionth" },
2862+ { "quadrillion", "quadrillionth" },
2863+ { "quintillion", "quintillionth" }
2864+};
2865+
2866+inline zstring if_space( zstring const &s ) {
2867+ return s.empty() ? "" : ' ' + s;
2868+}
2869+
2870+static zstring hundreds( int64_t n, bool ordinal ) {
2871+ if ( n < 20 )
2872+ return ones[ n ][ ordinal ];
2873+ zstring const tmp( if_space( ones[ n % 10 ][ ordinal ] ) );
2874+ return tens[ n / 10 ][ ordinal && tmp.empty() ] + tmp;
2875+}
2876+
2877+} // namespace english_impl
2878+
2879+zstring english( int64_t n, bool ordinal ) {
2880+ using namespace english_impl;
2881+
2882+ if ( !n )
2883+ return ordinal ? "zeroth" : "zero";
2884+
2885+ bool const negative = n < 0;
2886+ if ( negative )
2887+ n = -n;
2888+
2889+ int big_count = 0;
2890+ bool big_ordinal = ordinal;
2891+ zstring r;
2892+
2893+ while ( n ) {
2894+ if ( int64_t const m = n % 1000 ) {
2895+ zstring s;
2896+ if ( m < 100 )
2897+ s = hundreds( m, ordinal );
2898+ else {
2899+ zstring const tmp( if_space( hundreds( m % 100, ordinal ) ) );
2900+ s = ones[ m / 100 ][0] + ' '
2901+ + (ordinal && tmp.empty() ? "hundredth" : "hundred") + tmp;
2902+ }
2903+ zstring const tmp( if_space( r ) );
2904+ r = s + if_space( big[ big_count ][ big_ordinal && tmp.empty() ] + tmp );
2905+ big_ordinal = false;
2906+ }
2907+ n /= 1000;
2908+ ++big_count;
2909+ ordinal = false;
2910+ }
2911+
2912+ if ( negative )
2913+ r.insert( 0, "negative " );
2914+ return r;
2915+}
2916+
2917+char const* ordinal( long long n ) {
2918+ n = std::abs( n );
2919+ switch ( n % 100 ) {
2920+ case 11:
2921+ case 12:
2922+ case 13:
2923+ break;
2924+ default:
2925+ switch ( n % 10 ) {
2926+ case 1: return "st";
2927+ case 2: return "nd";
2928+ case 3: return "rd";
2929+ }
2930+ }
2931+ return "th";
2932+}
2933+
2934+///////////////////////////////////////////////////////////////////////////////
2935+
2936 } // namespace ztd
2937 } // namespace zorba
2938 /* vim:set et sw=2 ts=2: */
2939
2940=== modified file 'src/util/string_util.h'
2941--- src/util/string_util.h 2013-03-11 21:58:20 +0000
2942+++ src/util/string_util.h 2013-04-01 03:35:28 +0000
2943@@ -18,16 +18,20 @@
2944 #ifndef ZORBA_STRING_UTIL_H
2945 #define ZORBA_STRING_UTIL_H
2946
2947+// standard
2948+#include <cctype>
2949 #include <cstring>
2950 #include <limits>
2951 #include <sstream>
2952 #include <stdexcept>
2953 #include <string>
2954
2955+// Zorba
2956 #include <zorba/internal/ztd.h>
2957 #include "ascii_util.h"
2958 #include "cxx_util.h"
2959 #include "stl_util.h"
2960+#include "zorbatypes/zstring.h"
2961
2962 #ifdef WIN32
2963 // Windows annoyingly defines these as macros.
2964@@ -790,6 +794,37 @@
2965 *out = s ? s : "<null>";
2966 }
2967
2968+////////// Miscellaneous ///////////////////////////////////////////////////////
2969+
2970+/**
2971+ * Converts an integer to an alphabetic string: 1 = A, 2 = B, ..., 26 = Z, 27 =
2972+ * AA, 28 = AB, .... Note that 0 remains 0.
2973+ *
2974+ * @param n The integer to convert.
2975+ * @param capital If \c true, capital letters are used; if \c false, lower case
2976+ * letters are used.
2977+ * @return Returns \a n as an alphabetic string or "0" if \a n is zero.
2978+ */
2979+zstring alpha( unsigned long long n, bool capital );
2980+
2981+/**
2982+ * Converts a signed integer to English, e.g, 42 becomes "forty two".
2983+ *
2984+ * @param n The integer to convert.
2985+ * @param ordinal If \c true, ordinal words ("forty second") are returned.
2986+ * @return Returns \a n in English.
2987+ */
2988+zstring english( int64_t n, bool ordinal = false );
2989+
2990+/**
2991+ * Returns the English ordinal suffix for an integer, e.g., "st" for 1, "nd"
2992+ * for 2, etc.
2993+ *
2994+ * @param n The integer to return the ordinal suffix for.
2995+ * @return Returns said suffix.
2996+ */
2997+char const* ordinal( long long n );
2998+
2999 ///////////////////////////////////////////////////////////////////////////////
3000
3001 } // namespace ztd
3002
3003=== modified file 'src/util/unicode_categories.cpp'
3004--- src/util/unicode_categories.cpp 2013-02-28 11:15:32 +0000
3005+++ src/util/unicode_categories.cpp 2013-04-01 03:35:28 +0000
3006@@ -65885,6 +65885,22 @@
3007 return false;
3008 }
3009
3010+bool is_grouping_separator( code_point cp ) {
3011+ //
3012+ // XQuery 3.0 F&O: 4.6.1: a grouping-separator-sign is a non-alphanumeric
3013+ // character, that is a character whose Unicode category is other than Nd,
3014+ // Nl, No, Lu, Ll, Lt, Lm or Lo.
3015+ //
3016+ return !( is_category( cp, Nd )
3017+ || is_category( cp, Nl )
3018+ || is_category( cp, No )
3019+ || is_category( cp, Lu )
3020+ || is_category( cp, Ll )
3021+ || is_category( cp, Lt )
3022+ || is_category( cp, Lm )
3023+ || is_category( cp, Lo ) );
3024+}
3025+
3026 bool is_Nd( code_point cp, code_point *zero ) {
3027 for ( code_point const *z = Nd_zeros; z < Nd_zeros_end; ++z ) {
3028 if ( cp <= *z + 9 ) {
3029
3030=== modified file 'src/util/unicode_util.h'
3031--- src/util/unicode_util.h 2013-03-08 00:59:55 +0000
3032+++ src/util/unicode_util.h 2013-04-01 03:35:28 +0000
3033@@ -128,6 +128,25 @@
3034 typedef zstring string;
3035 #endif /* ZORBA_NO_ICU */
3036
3037+////////// constants //////////////////////////////////////////////////////////
3038+
3039+//
3040+// Various '1' digits.
3041+//
3042+code_point const CIRCLED_DIGIT_ONE = 0x2460;
3043+code_point const CIRCLED_IDEOGRAPH_ONE = 0x3280;
3044+code_point const DIGIT_ONE_FULL_STOP = 0x2488;
3045+code_point const DINGBAT_CIRCLED_SANS_SERIF_DIGIT_ONE = 0x2780;
3046+code_point const DINGBAT_NEGATIVE_CIRCLED_DIGIT_ONE = 0x2776;
3047+code_point const DINGBAT_NEGATIVE_CIRCLED_SANS_SERIF_DIGIT_ONE = 0x278A;
3048+code_point const DOUBLE_CIRCLED_DIGIT_ONE = 0x24F5;
3049+code_point const PARENTHESIZED_DIGIT_ONE = 0x2474;
3050+code_point const PARENTHESIZED_IDEOGRAPH_ONE = 0x3220;
3051+code_point const ROMAN_NUMERAL_ONE = 0x2160;
3052+code_point const SMALL_ROMAN_NUMERAL_ONE = 0x2170;
3053+code_point const SUBSCRIPT_ONE = 0x2081;
3054+code_point const SUPERSCRIPT_ONE = 0x00B9;
3055+
3056 ////////// code-point checking ////////////////////////////////////////////////
3057
3058 /**
3059@@ -135,18 +154,29 @@
3060 *
3061 * @param cp The code-point to check.
3062 * @param c The Unicode category.
3063- * @return Returns \c return only if \a cp is in \a c.
3064+ * @return Returns \c true only if \a cp is in \a c.
3065 */
3066 bool is_category( code_point cp, category c );
3067
3068 /**
3069+ * Checks whether a code-point is a grouping-separator. From XQuery 3.0 F&O
3070+ * 4.6.1: a grouping-separator-sign is a non-alphanumeric character, that is a
3071+ * character whose Unicode category is other than Nd, Nl, No, Lu, Ll, Lt, Lm or
3072+ * Lo.
3073+ *
3074+ * @param cp The code-point to check.
3075+ * @return Returns \c true only if \a cp is a grouping-separator.
3076+ */
3077+bool is_grouping_separator( code_point cp );
3078+
3079+/**
3080 * Checks whether a code-point is in the Unicode Nd (Number, Decimal Digit)
3081 * category.
3082 *
3083 * @param cp The code-point to check.
3084 * @param zero If non-null, set to the code-point of the zero at the start of
3085 * the consecutive range of digits.
3086- * @return Returns \c true only if \c cp is an Nd.
3087+ * @return Returns \c true only if \a cp is an Nd.
3088 */
3089 bool is_Nd( code_point cp, code_point *zero = nullptr );
3090
3091@@ -154,7 +184,7 @@
3092 * Checks whether the given character is invalid in an IRI.
3093 *
3094 * @param c The character.
3095- * @return Returns \c true only if the character is invalid in an IRI.
3096+ * @return Returns \c true only if \a c is invalid in an IRI.
3097 * See RFC 3987.
3098 */
3099 bool is_invalid_in_iri( code_point c );
3100@@ -163,7 +193,7 @@
3101 * Checks whether the given character is a "iprivate".
3102 *
3103 * @param c The character.
3104- * @return Returns \c true only if the character is a "iprivate".
3105+ * @return Returns \c true only if \c is a "iprivate".
3106 * See RFC 3987.
3107 */
3108 bool is_iprivate( code_point c );
3109
3110=== modified file 'src/zorbatypes/integer.cpp'
3111--- src/zorbatypes/integer.cpp 2013-03-11 15:00:50 +0000
3112+++ src/zorbatypes/integer.cpp 2013-04-01 03:35:28 +0000
3113@@ -19,6 +19,7 @@
3114 #include <cerrno>
3115 #include <cstdlib>
3116
3117+#include <zorba/internal/unique_ptr.h>
3118 #include "util/cxx_util.h"
3119 #include "util/string_util.h"
3120
3121@@ -365,11 +366,9 @@
3122 TEMPLATE_DECL(T)
3123 typename INTEGER_IMPL(T)::value_type INTEGER_IMPL(T)::ftoi( MAPM const &d ) {
3124 MAPM const temp( d.sign() >= 0 ? d.floor() : d.ceil() );
3125- char *const buf = new char[ temp.exponent() + 3 ];
3126- temp.toIntegerString( buf );
3127- value_type const result( ztd::aton<value_type>( buf ) );
3128- delete[] buf;
3129- return result;
3130+ unique_ptr<char[]> const buf( new char[ temp.exponent() + 3 ] );
3131+ temp.toIntegerString( buf.get() );
3132+ return ztd::aton<value_type>( buf.get() );
3133 }
3134
3135 TEMPLATE_DECL(T)
3136@@ -432,11 +431,9 @@
3137 TEMPLATE_DECL(T)
3138 zstring INTEGER_IMPL(T)::toString() const {
3139 #ifdef ZORBA_WITH_BIG_INTEGER
3140- char *const buf = new char[ value_.exponent() + 3 ];
3141- value_.toIntegerString( buf );
3142- zstring const result( buf );
3143- delete[] buf;
3144- return result;
3145+ unique_ptr<char[]> const buf( new char[ value_.exponent() + 3 ] );
3146+ value_.toIntegerString( buf.get() );
3147+ return buf.get();
3148 #else
3149 ascii::itoa_buf_type buf;
3150 return ascii::itoa( value_, buf );
3151
3152=== modified file 'test/fots/CMakeLists.txt'
3153--- test/fots/CMakeLists.txt 2013-03-27 17:11:24 +0000
3154+++ test/fots/CMakeLists.txt 2013-04-01 03:35:28 +0000
3155@@ -174,25 +174,10 @@
3156 EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-005 0)
3157 EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-006 0)
3158 EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-011 0)
3159-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-030 0)
3160-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-031 0)
3161-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-033 0)
3162-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-035 0)
3163-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-038 0)
3164-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-039 0)
3165-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-043 0)
3166-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-044 0)
3167+EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-044 1162631)
3168 EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-049 0)
3169 EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-050 0)
3170 EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-052 0)
3171-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-055 0)
3172-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-056 0)
3173-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-057 0)
3174-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-058 0)
3175-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-059 0)
3176-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-060 0)
3177-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-063 0)
3178-EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-064 0)
3179 EXPECTED_FOTS_FAILURE (fn-format-number numberformat14 0)
3180 EXPECTED_FOTS_FAILURE (fn-format-number numberformat15 0)
3181 EXPECTED_FOTS_FAILURE (fn-format-number numberformat34 0)
3182
3183=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal1.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-01.xml.res'
3184--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal1.xml.res 2013-02-07 17:24:36 +0000
3185+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-01.xml.res 2013-04-01 03:35:28 +0000
3186@@ -1,2 +1,1 @@
3187-<?xml version="1.0" encoding="UTF-8"?>
3188-1
3189\ No newline at end of file
3190+true
3191
3192=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-02.xml.res'
3193--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-02.xml.res 1970-01-01 00:00:00 +0000
3194+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-02.xml.res 2013-04-01 03:35:28 +0000
3195@@ -0,0 +1,1 @@
3196+true
3197
3198=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-03.xml.res'
3199--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-03.xml.res 1970-01-01 00:00:00 +0000
3200+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-03.xml.res 2013-04-01 03:35:28 +0000
3201@@ -0,0 +1,1 @@
3202+true
3203
3204=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal4.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-04.xml.res'
3205--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal4.xml.res 2013-02-07 17:24:36 +0000
3206+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-04.xml.res 2013-04-01 03:35:28 +0000
3207@@ -1,2 +1,1 @@
3208-<?xml version="1.0" encoding="UTF-8"?>
3209-1-2-3
3210\ No newline at end of file
3211+true
3212
3213=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-05.xml.res'
3214--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-05.xml.res 1970-01-01 00:00:00 +0000
3215+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-05.xml.res 2013-04-01 03:35:28 +0000
3216@@ -0,0 +1,1 @@
3217+true
3218
3219=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-06.xml.res'
3220--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-06.xml.res 1970-01-01 00:00:00 +0000
3221+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-06.xml.res 2013-04-01 03:35:28 +0000
3222@@ -0,0 +1,1 @@
3223+true
3224
3225=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-07.xml.res'
3226--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-07.xml.res 1970-01-01 00:00:00 +0000
3227+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-07.xml.res 2013-04-01 03:35:28 +0000
3228@@ -0,0 +1,1 @@
3229+true
3230
3231=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-08.xml.res'
3232--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-08.xml.res 1970-01-01 00:00:00 +0000
3233+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-08.xml.res 2013-04-01 03:35:28 +0000
3234@@ -0,0 +1,1 @@
3235+true
3236
3237=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal5.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-09.xml.res'
3238--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal5.xml.res 2013-02-07 17:24:36 +0000
3239+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-1-09.xml.res 2013-04-01 03:35:28 +0000
3240@@ -1,2 +1,1 @@
3241-<?xml version="1.0" encoding="UTF-8"?>
3242-001
3243\ No newline at end of file
3244+true
3245
3246=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-1.xml.res'
3247--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-1.xml.res 1970-01-01 00:00:00 +0000
3248+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-1.xml.res 2013-04-01 03:35:28 +0000
3249@@ -0,0 +1,1 @@
3250+true
3251
3252=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ2.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-2.xml.res'
3253--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ2.xml.res 2013-02-07 17:24:36 +0000
3254+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-2.xml.res 2013-04-01 03:35:28 +0000
3255@@ -1,2 +1,1 @@
3256-<?xml version="1.0" encoding="UTF-8"?>
3257-Z
3258\ No newline at end of file
3259+true
3260
3261=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-3.xml.res'
3262--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-3.xml.res 1970-01-01 00:00:00 +0000
3263+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-3.xml.res 2013-04-01 03:35:28 +0000
3264@@ -0,0 +1,1 @@
3265+true
3266
3267=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-4.xml.res'
3268--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-4.xml.res 1970-01-01 00:00:00 +0000
3269+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-4.xml.res 2013-04-01 03:35:28 +0000
3270@@ -0,0 +1,1 @@
3271+true
3272
3273=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ3.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-5.xml.res'
3274--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ3.xml.res 2013-02-07 17:24:36 +0000
3275+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-5.xml.res 2013-04-01 03:35:28 +0000
3276@@ -1,2 +1,1 @@
3277-<?xml version="1.0" encoding="UTF-8"?>
3278-aa
3279\ No newline at end of file
3280+true
3281
3282=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ4.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-6.xml.res'
3283--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ4.xml.res 2013-02-07 17:24:36 +0000
3284+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-6.xml.res 2013-04-01 03:35:28 +0000
3285@@ -1,2 +1,1 @@
3286-<?xml version="1.0" encoding="UTF-8"?>
3287-az
3288\ No newline at end of file
3289+true
3290
3291=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ5.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-7.xml.res'
3292--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ5.xml.res 2013-02-07 17:24:36 +0000
3293+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-A-7.xml.res 2013-04-01 03:35:28 +0000
3294@@ -1,2 +1,1 @@
3295-<?xml version="1.0" encoding="UTF-8"?>
3296-ba
3297\ No newline at end of file
3298+true
3299
3300=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-I-2.xml.res'
3301--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-I-2.xml.res 1970-01-01 00:00:00 +0000
3302+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-I-2.xml.res 2013-04-01 03:35:28 +0000
3303@@ -0,0 +1,1 @@
3304+true
3305
3306=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-1.xml.res'
3307--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-1.xml.res 1970-01-01 00:00:00 +0000
3308+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-1.xml.res 2013-04-01 03:35:28 +0000
3309@@ -0,0 +1,1 @@
3310+true
3311
3312=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-2.xml.res'
3313--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-2.xml.res 1970-01-01 00:00:00 +0000
3314+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-2.xml.res 2013-04-01 03:35:28 +0000
3315@@ -0,0 +1,1 @@
3316+true
3317
3318=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-3.xml.res'
3319--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-3.xml.res 1970-01-01 00:00:00 +0000
3320+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-3.xml.res 2013-04-01 03:35:28 +0000
3321@@ -0,0 +1,1 @@
3322+true
3323
3324=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-4.xml.res'
3325--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-4.xml.res 1970-01-01 00:00:00 +0000
3326+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-4.xml.res 2013-04-01 03:35:28 +0000
3327@@ -0,0 +1,1 @@
3328+true
3329
3330=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-5.xml.res'
3331--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-5.xml.res 1970-01-01 00:00:00 +0000
3332+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-5.xml.res 2013-04-01 03:35:28 +0000
3333@@ -0,0 +1,1 @@
3334+true
3335
3336=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-6.xml.res'
3337--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-6.xml.res 1970-01-01 00:00:00 +0000
3338+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-6.xml.res 2013-04-01 03:35:28 +0000
3339@@ -0,0 +1,1 @@
3340+true
3341
3342=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-7.xml.res'
3343--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-7.xml.res 1970-01-01 00:00:00 +0000
3344+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Thai-7.xml.res 2013-04-01 03:35:28 +0000
3345@@ -0,0 +1,1 @@
3346+true
3347
3348=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Wo-1.xml.res'
3349--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Wo-1.xml.res 1970-01-01 00:00:00 +0000
3350+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Wo-1.xml.res 2013-04-01 03:35:28 +0000
3351@@ -0,0 +1,1 @@
3352+true
3353
3354=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En2.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Wwo.xml.res'
3355--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En2.xml.res 2013-02-07 17:24:36 +0000
3356+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-Wwo.xml.res 2013-04-01 03:35:28 +0000
3357@@ -1,2 +1,1 @@
3358-<?xml version="1.0" encoding="UTF-8"?>
3359-Eleventh
3360\ No newline at end of file
3361+true
3362
3363=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-1.xml.res'
3364--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-1.xml.res 1970-01-01 00:00:00 +0000
3365+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-1.xml.res 2013-04-01 03:35:28 +0000
3366@@ -0,0 +1,1 @@
3367+true
3368
3369=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-3.xml.res'
3370--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-3.xml.res 1970-01-01 00:00:00 +0000
3371+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-3.xml.res 2013-04-01 03:35:28 +0000
3372@@ -0,0 +1,1 @@
3373+true
3374
3375=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman2.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-4.xml.res'
3376--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman2.xml.res 2013-02-07 17:24:36 +0000
3377+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-4.xml.res 2013-04-01 03:35:28 +0000
3378@@ -1,2 +1,1 @@
3379-<?xml version="1.0" encoding="UTF-8"?>
3380-III
3381\ No newline at end of file
3382+true
3383
3384=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman1.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-5.xml.res'
3385--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman1.xml.res 2013-02-07 17:24:36 +0000
3386+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-i-5.xml.res 2013-04-01 03:35:28 +0000
3387@@ -1,2 +1,1 @@
3388-<?xml version="1.0" encoding="UTF-8"?>
3389--i
3390\ No newline at end of file
3391+true
3392
3393=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-01.xml.res'
3394--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-01.xml.res 1970-01-01 00:00:00 +0000
3395+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-01.xml.res 2013-04-01 03:35:28 +0000
3396@@ -0,0 +1,1 @@
3397+true
3398
3399=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-02.xml.res'
3400--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-02.xml.res 1970-01-01 00:00:00 +0000
3401+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-02.xml.res 2013-04-01 03:35:28 +0000
3402@@ -0,0 +1,1 @@
3403+true
3404
3405=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-03.xml.res'
3406--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-03.xml.res 1970-01-01 00:00:00 +0000
3407+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-03.xml.res 2013-04-01 03:35:28 +0000
3408@@ -0,0 +1,1 @@
3409+true
3410
3411=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-04.xml.res'
3412--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-04.xml.res 1970-01-01 00:00:00 +0000
3413+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-04.xml.res 2013-04-01 03:35:28 +0000
3414@@ -0,0 +1,1 @@
3415+true
3416
3417=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-05.xml.res'
3418--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-05.xml.res 1970-01-01 00:00:00 +0000
3419+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-05.xml.res 2013-04-01 03:35:28 +0000
3420@@ -0,0 +1,1 @@
3421+true
3422
3423=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-06.xml.res'
3424--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-06.xml.res 1970-01-01 00:00:00 +0000
3425+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-one-06.xml.res 2013-04-01 03:35:28 +0000
3426@@ -0,0 +1,1 @@
3427+true
3428
3429=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-1.xml.res'
3430--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-1.xml.res 1970-01-01 00:00:00 +0000
3431+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-1.xml.res 2013-04-01 03:35:28 +0000
3432@@ -0,0 +1,1 @@
3433+true
3434
3435=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En1.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-2.xml.res'
3436--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En1.xml.res 2013-02-07 17:24:36 +0000
3437+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-2.xml.res 2013-04-01 03:35:28 +0000
3438@@ -1,2 +1,1 @@
3439-<?xml version="1.0" encoding="UTF-8"?>
3440-minus one
3441\ No newline at end of file
3442+true
3443
3444=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-3.xml.res'
3445--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-3.xml.res 1970-01-01 00:00:00 +0000
3446+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-3.xml.res 2013-04-01 03:35:28 +0000
3447@@ -0,0 +1,1 @@
3448+true
3449
3450=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En6.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-4.xml.res'
3451--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En6.xml.res 2013-02-07 17:24:36 +0000
3452+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-4.xml.res 2013-04-01 03:35:28 +0000
3453@@ -1,2 +1,1 @@
3454-<?xml version="1.0" encoding="UTF-8"?>
3455-TWO HUNDRED FORTY-FOURTH
3456\ No newline at end of file
3457+true
3458
3459=== renamed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En7.xml.res' => 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-5.xml.res'
3460--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En7.xml.res 2013-02-07 17:24:36 +0000
3461+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-w-5.xml.res 2013-04-01 03:35:28 +0000
3462@@ -1,2 +1,1 @@
3463-<?xml version="1.0" encoding="UTF-8"?>
3464-one thousand one hundredth
3465\ No newline at end of file
3466+true
3467
3468=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-2.xml.res'
3469--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-2.xml.res 1970-01-01 00:00:00 +0000
3470+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-2.xml.res 2013-04-01 03:35:28 +0000
3471@@ -0,0 +1,1 @@
3472+true
3473
3474=== added file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-3.xml.res'
3475--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-3.xml.res 1970-01-01 00:00:00 +0000
3476+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format-integer-wo-3.xml.res 2013-04-01 03:35:28 +0000
3477@@ -0,0 +1,1 @@
3478+true
3479
3480=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ1.xml.res'
3481--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ1.xml.res 2013-02-07 17:24:36 +0000
3482+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ1.xml.res 1970-01-01 00:00:00 +0000
3483@@ -1,2 +0,0 @@
3484-<?xml version="1.0" encoding="UTF-8"?>
3485--a
3486\ No newline at end of file
3487
3488=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ6.xml.res'
3489--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ6.xml.res 2013-02-07 17:24:36 +0000
3490+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ6.xml.res 1970-01-01 00:00:00 +0000
3491@@ -1,2 +0,0 @@
3492-<?xml version="1.0" encoding="UTF-8"?>
3493-zz
3494\ No newline at end of file
3495
3496=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ7.xml.res'
3497--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ7.xml.res 2013-02-07 17:24:36 +0000
3498+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ7.xml.res 1970-01-01 00:00:00 +0000
3499@@ -1,2 +0,0 @@
3500-<?xml version="1.0" encoding="UTF-8"?>
3501-aaa
3502\ No newline at end of file
3503
3504=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ9.xml.res'
3505--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ9.xml.res 2013-02-07 17:24:36 +0000
3506+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_AZ9.xml.res 1970-01-01 00:00:00 +0000
3507@@ -1,1 +0,0 @@
3508-<?xml version="1.0" encoding="UTF-8"?>
3509
3510=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En3.xml.res'
3511--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En3.xml.res 2013-02-07 17:24:36 +0000
3512+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En3.xml.res 1970-01-01 00:00:00 +0000
3513@@ -1,2 +0,0 @@
3514-<?xml version="1.0" encoding="UTF-8"?>
3515-one hundred one
3516\ No newline at end of file
3517
3518=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En4.xml.res'
3519--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En4.xml.res 2013-02-07 17:24:36 +0000
3520+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En4.xml.res 1970-01-01 00:00:00 +0000
3521@@ -1,2 +0,0 @@
3522-<?xml version="1.0" encoding="UTF-8"?>
3523-zero
3524\ No newline at end of file
3525
3526=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En5.xml.res'
3527--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En5.xml.res 2013-02-07 17:24:36 +0000
3528+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En5.xml.res 1970-01-01 00:00:00 +0000
3529@@ -1,2 +0,0 @@
3530-<?xml version="1.0" encoding="UTF-8"?>
3531-MINUS ONE HUNDRED TWENTY-THREE BILLION FOUR HUNDRED FIFTY-SIX MILLION SEVEN HUNDRED EIGHTY-NINE THOUSAND ONE HUNDRED TWENTY-THREE CENTILLION FOUR HUNDRED FIFTY-SIX QUINDECILLION SEVEN HUNDRED EIGHTY-NINE QUATTUORDECILLION ONE HUNDRED TWENTY-THREE TREDECILLION FOUR HUNDRED FIFTY-SIX DUODECILLION SEVEN HUNDRED EIGHTY-NINE UNDECILLION ONE HUNDRED TWENTY-THREE DECILLION FOUR HUNDRED FIFTY-SIX NONILLION SEVEN HUNDRED EIGHTY-NINE OCTILLION ONE HUNDRED TWENTY-THREE SEPTILLION FOUR HUNDRED FIFTY-SIX SEXTILLION SEVEN HUNDRED EIGHTY-NINE QUINTILLION ONE HUNDRED TWENTY-THREE QUADRILLION FOUR HUNDRED FIFTY-SIX TRILLION SEVEN HUNDRED EIGHTY-NINE BILLION ONE HUNDRED TWENTY-THREE MILLION FOUR HUNDRED FIFTY-SIX THOUSAND SEVEN HUNDRED EIGHTY-NINE VIGINTILLION ONE HUNDRED TWENTY-THREE NOVEMDECILLION FOUR HUNDRED FIFTY-SIX OCTODECILLION SEVEN HUNDRED EIGHTY-NINE SEPTENDECILLION ONE HUNDRED TWENTY-THREE SEXDECILLION FOUR HUNDRED FIFTY-SIX QUINDECILLION SEVEN HUNDRED EIGHTY-NINE QUATTUORDECILLION ONE HUNDRED TWENTY-THREE TREDECILLION FOUR HUNDRED FIFTY-SIX DUODECILLION SEVEN HUNDRED EIGHTY-NINE UNDECILLION ONE HUNDRED TWENTY-THREE DECILLION FOUR HUNDRED FIFTY-SIX NONILLION SEVEN HUNDRED EIGHTY-NINE OCTILLION ONE HUNDRED TWENTY-THREE SEPTILLION FOUR HUNDRED FIFTY-SIX SEXTILLION SEVEN HUNDRED EIGHTY-NINE QUINTILLION ONE HUNDRED TWENTY-THREE QUADRILLION FOUR HUNDRED FIFTY-SIX TRILLION SEVEN HUNDRED EIGHTY-NINE BILLION ONE HUNDRED TWENTY-THREE MILLION FOUR HUNDRED FIFTY-SIX THOUSAND SEVEN HUNDRED EIGHTY-NINE VIGINTILLION ONE HUNDRED TWENTY-THREE NOVEMDECILLION FOUR HUNDRED FIFTY-SIX OCTODECILLION SEVEN HUNDRED EIGHTY-NINE SEPTENDECILLION ONE HUNDRED TWENTY-THREE SEXDECILLION FOUR HUNDRED FIFTY-SIX QUINDECILLION SEVEN HUNDRED EIGHTY-NINE QUATTUORDECILLION ONE HUNDRED TWENTY-THREE TREDECILLION FOUR HUNDRED FIFTY-SIX DUODECILLION SEVEN HUNDRED EIGHTY-NINE UNDECILLION ONE HUNDRED TWENTY-THREE DECILLION FOUR HUNDRED FIFTY-SIX NONILLION SEVEN HUNDRED EIGHTY-NINE OCTILLION ONE HUNDRED TWENTY-THREE SEPTILLION FOUR HUNDRED FIFTY-SIX SEXTILLION SEVEN HUNDRED EIGHTY-NINE QUINTILLION ONE HUNDRED TWENTY-THREE QUADRILLION FOUR HUNDRED FIFTY-SIX TRILLION SEVEN HUNDRED EIGHTY-NINE BILLION ONE HUNDRED TWENTY-THREE MILLION FOUR HUNDRED FIFTY-SIX THOUSAND SEVEN HUNDRED EIGHTY-NINE VIGINTILLION ONE HUNDRED TWENTY-THREE NOVEMDECILLION FOUR HUNDRED FIFTY-SIX OCTODECILLION SEVEN HUNDRED EIGHTY-NINE SEPTENDECILLION ONE HUNDRED TWENTY-THREE SEXDECILLION FOUR HUNDRED FIFTY-SIX QUINDECILLION SEVEN HUNDRED EIGHTY-NINE QUATTUORDECILLION ONE HUNDRED TWENTY-THREE TREDECILLION FOUR HUNDRED FIFTY-SIX DUODECILLION SEVEN HUNDRED EIGHTY-NINE UNDECILLION ONE HUNDRED TWENTY-THREE DECILLION FOUR HUNDRED FIFTY-SIX NONILLION SEVEN HUNDRED EIGHTY-NINE OCTILLION ONE HUNDRED TWENTY-THREE SEPTILLION FOUR HUNDRED FIFTY-SIX SEXTILLION SEVEN HUNDRED EIGHTY-NINE QUINTILLION ONE HUNDRED TWENTY-THREE QUADRILLION FOUR HUNDRED FIFTY-SIX TRILLION SEVEN HUNDRED EIGHTY-NINE BILLION ONE HUNDRED TWENTY-THREE MILLION FOUR HUNDRED FIFTY-SIX THOUSAND SEVEN HUNDRED EIGHTY-NINE VIGINTILLION ONE HUNDRED TWENTY-THREE NOVEMDECILLION FOUR HUNDRED FIFTY-SIX OCTODECILLION SEVEN HUNDRED EIGHTY-NINE SEPTENDECILLION ONE HUNDRED TWENTY-THREE SEXDECILLION FOUR HUNDRED FIFTY-SIX QUINDECILLION SEVEN HUNDRED EIGHTY-NINE QUATTUORDECILLION ONE HUNDRED TWENTY-THREE TREDECILLION FOUR HUNDRED FIFTY-SIX DUODECILLION SEVEN HUNDRED EIGHTY-NINE UNDECILLION ONE HUNDRED TWENTY-THREE DECILLION FOUR HUNDRED FIFTY-SIX NONILLION SEVEN HUNDRED EIGHTY-NINE OCTILLION ONE HUNDRED TWENTY-THREE SEPTILLION FOUR HUNDRED FIFTY-SIX SEXTILLION SEVEN HUNDRED EIGHTY-NINE QUINTILLION ONE HUNDRED TWENTY-THREE QUADRILLION FOUR HUNDRED FIFTY-SIX TRILLION SEVEN HUNDRED EIGHTY-NINE BILLION ONE HUNDRED TWENTY-THREE MILLION FOUR HUNDRED FIFTY-SIX THOUSAND SEVEN HUNDRED EIGHTY-NINE
3532\ No newline at end of file
3533
3534=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En8.xml.res'
3535--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En8.xml.res 2013-02-07 17:24:36 +0000
3536+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En8.xml.res 1970-01-01 00:00:00 +0000
3537@@ -1,2 +0,0 @@
3538-<?xml version="1.0" encoding="UTF-8"?>
3539-minus second
3540\ No newline at end of file
3541
3542=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En9.xml.res'
3543--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En9.xml.res 2013-02-07 17:24:36 +0000
3544+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_En9.xml.res 1970-01-01 00:00:00 +0000
3545@@ -1,2 +0,0 @@
3546-<?xml version="1.0" encoding="UTF-8"?>
3547-Ten trillion
3548\ No newline at end of file
3549
3550=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman3.xml.res'
3551--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman3.xml.res 2013-02-07 17:24:36 +0000
3552+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman3.xml.res 1970-01-01 00:00:00 +0000
3553@@ -1,2 +0,0 @@
3554-<?xml version="1.0" encoding="UTF-8"?>
3555-ix
3556\ No newline at end of file
3557
3558=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman4.xml.res'
3559--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman4.xml.res 2013-02-07 17:24:36 +0000
3560+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman4.xml.res 1970-01-01 00:00:00 +0000
3561@@ -1,2 +0,0 @@
3562-<?xml version="1.0" encoding="UTF-8"?>
3563-xxix
3564\ No newline at end of file
3565
3566=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman5.xml.res'
3567--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman5.xml.res 2013-02-07 17:24:36 +0000
3568+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman5.xml.res 1970-01-01 00:00:00 +0000
3569@@ -1,2 +0,0 @@
3570-<?xml version="1.0" encoding="UTF-8"?>
3571-lxxxviii
3572\ No newline at end of file
3573
3574=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman6.xml.res'
3575--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman6.xml.res 2013-02-07 17:24:36 +0000
3576+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman6.xml.res 1970-01-01 00:00:00 +0000
3577@@ -1,2 +0,0 @@
3578-<?xml version="1.0" encoding="UTF-8"?>
3579-mmxi
3580\ No newline at end of file
3581
3582=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman7.xml.res'
3583--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman7.xml.res 2013-02-07 17:24:36 +0000
3584+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman7.xml.res 1970-01-01 00:00:00 +0000
3585@@ -1,2 +0,0 @@
3586-<?xml version="1.0" encoding="UTF-8"?>
3587-dcclxxvii
3588\ No newline at end of file
3589
3590=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman9.xml.res'
3591--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman9.xml.res 2013-02-07 17:24:36 +0000
3592+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_Roman9.xml.res 1970-01-01 00:00:00 +0000
3593@@ -1,1 +0,0 @@
3594-<?xml version="1.0" encoding="UTF-8"?>
3595
3596=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal10.xml.res'
3597--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal10.xml.res 2013-02-07 17:24:36 +0000
3598+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal10.xml.res 1970-01-01 00:00:00 +0000
3599@@ -1,2 +0,0 @@
3600-<?xml version="1.0" encoding="UTF-8"?>
3601--121st
3602\ No newline at end of file
3603
3604=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal2.xml.res'
3605--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal2.xml.res 2013-02-07 17:24:36 +0000
3606+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal2.xml.res 1970-01-01 00:00:00 +0000
3607@@ -1,2 +0,0 @@
3608-<?xml version="1.0" encoding="UTF-8"?>
3609-1
3610\ No newline at end of file
3611
3612=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal6.xml.res'
3613--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal6.xml.res 2013-02-07 17:24:36 +0000
3614+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal6.xml.res 1970-01-01 00:00:00 +0000
3615@@ -1,2 +0,0 @@
3616-<?xml version="1.0" encoding="UTF-8"?>
3617-0-0-1
3618\ No newline at end of file
3619
3620=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal7.xml.res'
3621--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal7.xml.res 2013-02-07 17:24:36 +0000
3622+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal7.xml.res 1970-01-01 00:00:00 +0000
3623@@ -1,2 +0,0 @@
3624-<?xml version="1.0" encoding="UTF-8"?>
3625-1-2-34
3626\ No newline at end of file
3627
3628=== removed file 'test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal9.xml.res'
3629--- test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal9.xml.res 2013-02-07 17:24:36 +0000
3630+++ test/rbkt/ExpQueryResults/zorba/math/format_integer/format_integer_decimal9.xml.res 1970-01-01 00:00:00 +0000
3631@@ -1,2 +0,0 @@
3632-<?xml version="1.0" encoding="UTF-8"?>
3633-123rd
3634\ No newline at end of file
3635
3636=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.spec'
3637--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.spec 1970-01-01 00:00:00 +0000
3638+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.spec 2013-04-01 03:35:28 +0000
3639@@ -0,0 +1,1 @@
3640+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3641
3642=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.xq'
3643--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.xq 1970-01-01 00:00:00 +0000
3644+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-date-MustBeOneMandatoryDigit.xq 2013-04-01 03:35:28 +0000
3645@@ -0,0 +1,1 @@
3646+fn:format-date( xs:date("2012-01-02"), "[Y#]" )
3647
3648=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.spec'
3649--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.spec 1970-01-01 00:00:00 +0000
3650+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.spec 2013-04-01 03:35:28 +0000
3651@@ -0,0 +1,1 @@
3652+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3653
3654=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.xq'
3655--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.xq 1970-01-01 00:00:00 +0000
3656+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifier-1.xq 2013-04-01 03:35:28 +0000
3657@@ -0,0 +1,1 @@
3658+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00x]" )
3659
3660=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.spec'
3661--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.spec 1970-01-01 00:00:00 +0000
3662+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.spec 2013-04-01 03:35:28 +0000
3663@@ -0,0 +1,1 @@
3664+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3665
3666=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.xq'
3667--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.xq 1970-01-01 00:00:00 +0000
3668+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-1.xq 2013-04-01 03:35:28 +0000
3669@@ -0,0 +1,1 @@
3670+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00oc]" )
3671
3672=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.spec'
3673--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.spec 1970-01-01 00:00:00 +0000
3674+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.spec 2013-04-01 03:35:28 +0000
3675@@ -0,0 +1,1 @@
3676+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3677
3678=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.xq'
3679--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.xq 1970-01-01 00:00:00 +0000
3680+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-2.xq 2013-04-01 03:35:28 +0000
3681@@ -0,0 +1,1 @@
3682+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00ac]" )
3683
3684=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.spec'
3685--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.spec 1970-01-01 00:00:00 +0000
3686+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.spec 2013-04-01 03:35:28 +0000
3687@@ -0,0 +1,1 @@
3688+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3689
3690=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.xq'
3691--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.xq 1970-01-01 00:00:00 +0000
3692+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-3.xq 2013-04-01 03:35:28 +0000
3693@@ -0,0 +1,1 @@
3694+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00tc]" )
3695
3696=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.spec'
3697--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.spec 1970-01-01 00:00:00 +0000
3698+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.spec 2013-04-01 03:35:28 +0000
3699@@ -0,0 +1,1 @@
3700+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3701
3702=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.xq'
3703--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.xq 1970-01-01 00:00:00 +0000
3704+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-4.xq 2013-04-01 03:35:28 +0000
3705@@ -0,0 +1,1 @@
3706+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00co]" )
3707
3708=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.spec'
3709--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.spec 1970-01-01 00:00:00 +0000
3710+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.spec 2013-04-01 03:35:28 +0000
3711@@ -0,0 +1,1 @@
3712+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3713
3714=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.xq'
3715--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.xq 1970-01-01 00:00:00 +0000
3716+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-5.xq 2013-04-01 03:35:28 +0000
3717@@ -0,0 +1,1 @@
3718+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00ao]" )
3719
3720=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.spec'
3721--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.spec 1970-01-01 00:00:00 +0000
3722+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.spec 2013-04-01 03:35:28 +0000
3723@@ -0,0 +1,1 @@
3724+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3725
3726=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.xq'
3727--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.xq 1970-01-01 00:00:00 +0000
3728+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-6.xq 2013-04-01 03:35:28 +0000
3729@@ -0,0 +1,1 @@
3730+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00to]" )
3731
3732=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.spec'
3733--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.spec 1970-01-01 00:00:00 +0000
3734+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.spec 2013-04-01 03:35:28 +0000
3735@@ -0,0 +1,1 @@
3736+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3737
3738=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.xq'
3739--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.xq 1970-01-01 00:00:00 +0000
3740+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-7.xq 2013-04-01 03:35:28 +0000
3741@@ -0,0 +1,1 @@
3742+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00ta]" )
3743
3744=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.spec'
3745--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.spec 1970-01-01 00:00:00 +0000
3746+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.spec 2013-04-01 03:35:28 +0000
3747@@ -0,0 +1,1 @@
3748+Error: http://www.w3.org/2005/xqt-errors:FOFD1340
3749
3750=== added file 'test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.xq'
3751--- test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.xq 1970-01-01 00:00:00 +0000
3752+++ test/rbkt/Queries/zorba/durationdatetime/FormatDateTimeFunc/format-time-Bad2ndModifierHere-8.xq 2013-04-01 03:35:28 +0000
3753@@ -0,0 +1,1 @@
3754+fn:format-time( xs:time("09:14:00-08:30"), "[Z00:00at]" )
3755
3756=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal1.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-01.xq'
3757--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal1.xq 2013-02-07 17:24:36 +0000
3758+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-01.xq 2013-04-01 03:35:28 +0000
3759@@ -1,1 +1,1 @@
3760-fn:format-integer(1, "3")
3761\ No newline at end of file
3762+fn:format-integer( 1, "0" ) eq "1"
3763
3764=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-02.xq'
3765--- test/rbkt/Queries/zorba/math/format_integer/format-integer-1-02.xq 1970-01-01 00:00:00 +0000
3766+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-02.xq 2013-04-01 03:35:28 +0000
3767@@ -0,0 +1,1 @@
3768+fn:format-integer( 1, "1" ) eq "1"
3769
3770=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-03.xq'
3771--- test/rbkt/Queries/zorba/math/format_integer/format-integer-1-03.xq 1970-01-01 00:00:00 +0000
3772+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-03.xq 2013-04-01 03:35:28 +0000
3773@@ -0,0 +1,1 @@
3774+fn:format-integer( 1, "2" ) eq "1"
3775
3776=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal4.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-04.xq'
3777--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal4.xq 2013-02-07 17:24:36 +0000
3778+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-04.xq 2013-04-01 03:35:28 +0000
3779@@ -1,1 +1,1 @@
3780-fn:format-integer(123, "#-3")
3781\ No newline at end of file
3782+fn:format-integer( 123, "#-3" ) eq "1-2-3"
3783
3784=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-05.xq'
3785--- test/rbkt/Queries/zorba/math/format_integer/format-integer-1-05.xq 1970-01-01 00:00:00 +0000
3786+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-05.xq 2013-04-01 03:35:28 +0000
3787@@ -0,0 +1,1 @@
3788+fn:format-integer( 15, "0'000" ) eq "0'015"
3789
3790=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-06.xq'
3791--- test/rbkt/Queries/zorba/math/format_integer/format-integer-1-06.xq 1970-01-01 00:00:00 +0000
3792+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-06.xq 2013-04-01 03:35:28 +0000
3793@@ -0,0 +1,1 @@
3794+fn:format-integer( 1000000, "0'000" ) eq "1'000'000"
3795
3796=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-07.xq'
3797--- test/rbkt/Queries/zorba/math/format_integer/format-integer-1-07.xq 1970-01-01 00:00:00 +0000
3798+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-07.xq 2013-04-01 03:35:28 +0000
3799@@ -0,0 +1,1 @@
3800+fn:format-integer( 15, "#'##0" ) eq "15"
3801
3802=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-08.xq'
3803--- test/rbkt/Queries/zorba/math/format_integer/format-integer-1-08.xq 1970-01-01 00:00:00 +0000
3804+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-08.xq 2013-04-01 03:35:28 +0000
3805@@ -0,0 +1,1 @@
3806+fn:format-integer( 1000000, "#'##0" ) eq "1'000'000"
3807
3808=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal5.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-1-09.xq'
3809--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal5.xq 2013-02-07 17:24:36 +0000
3810+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-1-09.xq 2013-04-01 03:35:28 +0000
3811@@ -1,1 +1,1 @@
3812-fn:format-integer(1, "003")
3813\ No newline at end of file
3814+fn:format-integer( 1, "009" ) eq "001"
3815
3816=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-A-1.xq'
3817--- test/rbkt/Queries/zorba/math/format_integer/format-integer-A-1.xq 1970-01-01 00:00:00 +0000
3818+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-A-1.xq 2013-04-01 03:35:28 +0000
3819@@ -0,0 +1,1 @@
3820+fn:format-integer( 1, "A" ) eq "A"
3821
3822=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ2.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-A-2.xq'
3823--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ2.xq 2013-02-07 17:24:36 +0000
3824+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-A-2.xq 2013-04-01 03:35:28 +0000
3825@@ -1,1 +1,1 @@
3826-fn:format-integer(26, "A")
3827\ No newline at end of file
3828+fn:format-integer( 26, "A" ) eq "Z"
3829
3830=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-A-3.xq'
3831--- test/rbkt/Queries/zorba/math/format_integer/format-integer-A-3.xq 1970-01-01 00:00:00 +0000
3832+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-A-3.xq 2013-04-01 03:35:28 +0000
3833@@ -0,0 +1,1 @@
3834+fn:format-integer( 0, "A" ) eq "0"
3835
3836=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-A-4.xq'
3837--- test/rbkt/Queries/zorba/math/format_integer/format-integer-A-4.xq 1970-01-01 00:00:00 +0000
3838+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-A-4.xq 2013-04-01 03:35:28 +0000
3839@@ -0,0 +1,1 @@
3840+fn:format-integer( -1, "A" ) eq "-A"
3841
3842=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ3.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-A-5.xq'
3843--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ3.xq 2013-02-07 17:24:36 +0000
3844+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-A-5.xq 2013-04-01 03:35:28 +0000
3845@@ -1,1 +1,1 @@
3846-fn:format-integer(27, "a")
3847\ No newline at end of file
3848+fn:format-integer( 27, "A" ) eq "AA"
3849
3850=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ4.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-A-6.xq'
3851--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ4.xq 2013-02-07 17:24:36 +0000
3852+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-A-6.xq 2013-04-01 03:35:28 +0000
3853@@ -1,1 +1,1 @@
3854-fn:format-integer(52, "a")
3855\ No newline at end of file
3856+fn:format-integer( 52, "A" ) eq "AZ"
3857
3858=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ5.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-A-7.xq'
3859--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ5.xq 2013-02-07 17:24:36 +0000
3860+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-A-7.xq 2013-04-01 03:35:28 +0000
3861@@ -1,1 +1,1 @@
3862-fn:format-integer(53, "a")
3863\ No newline at end of file
3864+fn:format-integer( 53, "A" ) eq "BA"
3865
3866=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.spec'
3867--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.spec 1970-01-01 00:00:00 +0000
3868+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.spec 2013-04-01 03:35:28 +0000
3869@@ -0,0 +1,1 @@
3870+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3871
3872=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.xq'
3873--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.xq 1970-01-01 00:00:00 +0000
3874+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-1.xq 2013-04-01 03:35:28 +0000
3875@@ -0,0 +1,1 @@
3876+fn:format-integer( 123, "1;x" )
3877
3878=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.spec'
3879--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.spec 1970-01-01 00:00:00 +0000
3880+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.spec 2013-04-01 03:35:28 +0000
3881@@ -0,0 +1,1 @@
3882+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3883
3884=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.xq'
3885--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.xq 1970-01-01 00:00:00 +0000
3886+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifier-2.xq 2013-04-01 03:35:28 +0000
3887@@ -0,0 +1,1 @@
3888+fn:format-integer( 123, "1x" )
3889
3890=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.spec'
3891--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.spec 1970-01-01 00:00:00 +0000
3892+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.spec 2013-04-01 03:35:28 +0000
3893@@ -0,0 +1,1 @@
3894+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3895
3896=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.xq'
3897--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.xq 1970-01-01 00:00:00 +0000
3898+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-1.xq 2013-04-01 03:35:28 +0000
3899@@ -0,0 +1,1 @@
3900+fn:format-integer( 123, "1;oc" )
3901
3902=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.spec'
3903--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.spec 1970-01-01 00:00:00 +0000
3904+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.spec 2013-04-01 03:35:28 +0000
3905@@ -0,0 +1,1 @@
3906+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3907
3908=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.xq'
3909--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.xq 1970-01-01 00:00:00 +0000
3910+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-2.xq 2013-04-01 03:35:28 +0000
3911@@ -0,0 +1,1 @@
3912+fn:format-integer( 123, "1;ac" )
3913
3914=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.spec'
3915--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.spec 1970-01-01 00:00:00 +0000
3916+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.spec 2013-04-01 03:35:28 +0000
3917@@ -0,0 +1,1 @@
3918+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3919
3920=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.xq'
3921--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.xq 1970-01-01 00:00:00 +0000
3922+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-3.xq 2013-04-01 03:35:28 +0000
3923@@ -0,0 +1,1 @@
3924+fn:format-integer( 123, "1;tc" )
3925
3926=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.spec'
3927--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.spec 1970-01-01 00:00:00 +0000
3928+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.spec 2013-04-01 03:35:28 +0000
3929@@ -0,0 +1,1 @@
3930+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3931
3932=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.xq'
3933--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.xq 1970-01-01 00:00:00 +0000
3934+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-4.xq 2013-04-01 03:35:28 +0000
3935@@ -0,0 +1,1 @@
3936+fn:format-integer( 123, "1;co" )
3937
3938=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.spec'
3939--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.spec 1970-01-01 00:00:00 +0000
3940+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.spec 2013-04-01 03:35:28 +0000
3941@@ -0,0 +1,1 @@
3942+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3943
3944=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.xq'
3945--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.xq 1970-01-01 00:00:00 +0000
3946+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-5.xq 2013-04-01 03:35:28 +0000
3947@@ -0,0 +1,1 @@
3948+fn:format-integer( 123, "1;ao" )
3949
3950=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.spec'
3951--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.spec 1970-01-01 00:00:00 +0000
3952+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.spec 2013-04-01 03:35:28 +0000
3953@@ -0,0 +1,1 @@
3954+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3955
3956=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.xq'
3957--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.xq 1970-01-01 00:00:00 +0000
3958+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-6.xq 2013-04-01 03:35:28 +0000
3959@@ -0,0 +1,1 @@
3960+fn:format-integer( 123, "1;to" )
3961
3962=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.spec'
3963--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.spec 1970-01-01 00:00:00 +0000
3964+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.spec 2013-04-01 03:35:28 +0000
3965@@ -0,0 +1,1 @@
3966+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3967
3968=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.xq'
3969--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.xq 1970-01-01 00:00:00 +0000
3970+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-7.xq 2013-04-01 03:35:28 +0000
3971@@ -0,0 +1,1 @@
3972+fn:format-integer( 123, "1;ta" )
3973
3974=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.spec'
3975--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.spec 1970-01-01 00:00:00 +0000
3976+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.spec 2013-04-01 03:35:28 +0000
3977@@ -0,0 +1,1 @@
3978+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3979
3980=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.xq'
3981--- test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.xq 1970-01-01 00:00:00 +0000
3982+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-BadFormatModifierHere-8.xq 2013-04-01 03:35:28 +0000
3983@@ -0,0 +1,1 @@
3984+fn:format-integer( 123, "1;at" )
3985
3986=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.spec'
3987--- test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.spec 1970-01-01 00:00:00 +0000
3988+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.spec 2013-04-01 03:35:28 +0000
3989@@ -0,0 +1,1 @@
3990+Error: http://www.w3.org/2005/xqt-errors:FODF1310
3991
3992=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.xq'
3993--- test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.xq 1970-01-01 00:00:00 +0000
3994+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-1.xq 2013-04-01 03:35:28 +0000
3995@@ -0,0 +1,1 @@
3996+fn:format-integer( 1, "" )
3997
3998=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.spec'
3999--- test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.spec 1970-01-01 00:00:00 +0000
4000+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.spec 2013-04-01 03:35:28 +0000
4001@@ -0,0 +1,1 @@
4002+Error: http://www.w3.org/2005/xqt-errors:FODF1310
4003
4004=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.xq'
4005--- test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.xq 1970-01-01 00:00:00 +0000
4006+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-EmptyFormat-2.xq 2013-04-01 03:35:28 +0000
4007@@ -0,0 +1,1 @@
4008+fn:format-integer( 1, ";o" )
4009
4010=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-I-2.xq'
4011--- test/rbkt/Queries/zorba/math/format_integer/format-integer-I-2.xq 1970-01-01 00:00:00 +0000
4012+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-I-2.xq 2013-04-01 03:35:28 +0000
4013@@ -0,0 +1,1 @@
4014+fn:format-integer( 1967, "I" ) eq "MCMLXVII"
4015
4016=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.spec'
4017--- test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.spec 1970-01-01 00:00:00 +0000
4018+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.spec 2013-04-01 03:35:28 +0000
4019@@ -0,0 +1,1 @@
4020+Error: http://www.w3.org/2005/xqt-errors:FODF1310
4021
4022=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.xq'
4023--- test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.xq 1970-01-01 00:00:00 +0000
4024+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoAdjacentGroupSep.xq 2013-04-01 03:35:28 +0000
4025@@ -0,0 +1,1 @@
4026+fn:format-integer( 12345, "0,,001" )
4027
4028=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.spec'
4029--- test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.spec 1970-01-01 00:00:00 +0000
4030+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.spec 2013-04-01 03:35:28 +0000
4031@@ -0,0 +1,1 @@
4032+Error: http://www.w3.org/2005/xqt-errors:FODF1310
4033
4034=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.xq'
4035--- test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.xq 1970-01-01 00:00:00 +0000
4036+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtEnd.xq 2013-04-01 03:35:28 +0000
4037@@ -0,0 +1,1 @@
4038+fn:format-integer( 123, "1," )
4039
4040=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal3.spec' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtStart.spec'
4041--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal3.spec 2013-02-07 17:24:36 +0000
4042+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtStart.spec 2013-04-01 03:35:28 +0000
4043@@ -1,1 +1,1 @@
4044-Error: http://www.w3.org/2005/xqt-errors:FOFI0002
4045+Error: http://www.w3.org/2005/xqt-errors:FODF1310
4046
4047=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal3.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtStart.xq'
4048--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal3.xq 2013-02-07 17:24:36 +0000
4049+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoGroupSepAtStart.xq 2013-04-01 03:35:28 +0000
4050@@ -1,1 +1,1 @@
4051-fn:format-integer(123, "-3")
4052\ No newline at end of file
4053+fn:format-integer( 123, "-1" )
4054
4055=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.spec'
4056--- test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.spec 1970-01-01 00:00:00 +0000
4057+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.spec 2013-04-01 03:35:28 +0000
4058@@ -0,0 +1,1 @@
4059+Error: http://www.w3.org/2005/xqt-errors:FODF1310
4060
4061=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.xq'
4062--- test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.xq 1970-01-01 00:00:00 +0000
4063+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-NoOptDigitAfterMandatory.xq 2013-04-01 03:35:28 +0000
4064@@ -0,0 +1,1 @@
4065+fn:format-integer( 1, "0#" )
4066
4067=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-1.xq'
4068--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-1.xq 1970-01-01 00:00:00 +0000
4069+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-1.xq 2013-04-01 03:35:28 +0000
4070@@ -0,0 +1,1 @@
4071+fn:format-integer( 15, "๐" ) eq "๑๕"
4072
4073=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-2.xq'
4074--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-2.xq 1970-01-01 00:00:00 +0000
4075+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-2.xq 2013-04-01 03:35:28 +0000
4076@@ -0,0 +1,1 @@
4077+fn:format-integer( 15, "๑" ) eq "๑๕"
4078
4079=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-3.xq'
4080--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-3.xq 1970-01-01 00:00:00 +0000
4081+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-3.xq 2013-04-01 03:35:28 +0000
4082@@ -0,0 +1,1 @@
4083+fn:format-integer( 15, "๐'๐๐๐" ) eq "๐'๐๑๕"
4084
4085=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-4.xq'
4086--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-4.xq 1970-01-01 00:00:00 +0000
4087+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-4.xq 2013-04-01 03:35:28 +0000
4088@@ -0,0 +1,1 @@
4089+fn:format-integer( 1000000, "๐'๐๐๐" ) eq "๑'๐๐๐'๐๐๐"
4090
4091=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-5.xq'
4092--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-5.xq 1970-01-01 00:00:00 +0000
4093+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-5.xq 2013-04-01 03:35:28 +0000
4094@@ -0,0 +1,1 @@
4095+fn:format-integer( 15, "#'##๐" ) eq "๑๕"
4096
4097=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-6.xq'
4098--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-6.xq 1970-01-01 00:00:00 +0000
4099+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-6.xq 2013-04-01 03:35:28 +0000
4100@@ -0,0 +1,1 @@
4101+fn:format-integer( 1000000, "#'##๐" ) eq "๑'๐๐๐'๐๐๐"
4102
4103=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-7.xq'
4104--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-7.xq 1970-01-01 00:00:00 +0000
4105+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Thai-7.xq 2013-04-01 03:35:28 +0000
4106@@ -0,0 +1,1 @@
4107+fn:format-integer( 1, "๐๐๙" ) eq "๐๐๑"
4108
4109=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Wo-1.xq'
4110--- test/rbkt/Queries/zorba/math/format_integer/format-integer-Wo-1.xq 1970-01-01 00:00:00 +0000
4111+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Wo-1.xq 2013-04-01 03:35:28 +0000
4112@@ -0,0 +1,1 @@
4113+fn:format-integer( 42, "W;o", "en_US" ) eq "FORTY SECOND"
4114
4115=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En2.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-Wwo.xq'
4116--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En2.xq 2013-02-07 17:24:36 +0000
4117+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-Wwo.xq 2013-04-01 03:35:28 +0000
4118@@ -1,1 +1,1 @@
4119-fn:format-integer(11, "Wwo")
4120\ No newline at end of file
4121+fn:format-integer( 42, "Ww;o", "en_US" ) eq "Forty Second"
4122
4123=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-i-1.xq'
4124--- test/rbkt/Queries/zorba/math/format_integer/format-integer-i-1.xq 1970-01-01 00:00:00 +0000
4125+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-i-1.xq 2013-04-01 03:35:28 +0000
4126@@ -0,0 +1,1 @@
4127+fn:format-integer( 1967, "i" ) eq "mcmlxvii"
4128
4129=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-i-3.xq'
4130--- test/rbkt/Queries/zorba/math/format_integer/format-integer-i-3.xq 1970-01-01 00:00:00 +0000
4131+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-i-3.xq 2013-04-01 03:35:28 +0000
4132@@ -0,0 +1,1 @@
4133+fn:format-integer( 0, "i" ) eq "0"
4134
4135=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman2.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-i-4.xq'
4136--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman2.xq 2013-02-07 17:24:36 +0000
4137+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-i-4.xq 2013-04-01 03:35:28 +0000
4138@@ -1,1 +1,1 @@
4139-fn:format-integer(3, "Io")
4140\ No newline at end of file
4141+fn:format-integer( 3, "I;o" ) eq "III"
4142
4143=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman1.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-i-5.xq'
4144--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman1.xq 2013-02-07 17:24:36 +0000
4145+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-i-5.xq 2013-04-01 03:35:28 +0000
4146@@ -1,1 +1,1 @@
4147-fn:format-integer(-1, "i")
4148\ No newline at end of file
4149+fn:format-integer( -1, "i" ) eq "-i"
4150
4151=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-one-01.xq'
4152--- test/rbkt/Queries/zorba/math/format_integer/format-integer-one-01.xq 1970-01-01 00:00:00 +0000
4153+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-one-01.xq 2013-04-01 03:35:28 +0000
4154@@ -0,0 +1,1 @@
4155+fn:format-integer( 1, "①" ) eq "①"
4156
4157=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-one-02.xq'
4158--- test/rbkt/Queries/zorba/math/format_integer/format-integer-one-02.xq 1970-01-01 00:00:00 +0000
4159+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-one-02.xq 2013-04-01 03:35:28 +0000
4160@@ -0,0 +1,1 @@
4161+fn:format-integer( 20, "①" ) eq "⑳"
4162
4163=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-one-03.xq'
4164--- test/rbkt/Queries/zorba/math/format_integer/format-integer-one-03.xq 1970-01-01 00:00:00 +0000
4165+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-one-03.xq 2013-04-01 03:35:28 +0000
4166@@ -0,0 +1,1 @@
4167+fn:format-integer( 21, "①" ) eq "21"
4168
4169=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-one-04.xq'
4170--- test/rbkt/Queries/zorba/math/format_integer/format-integer-one-04.xq 1970-01-01 00:00:00 +0000
4171+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-one-04.xq 2013-04-01 03:35:28 +0000
4172@@ -0,0 +1,1 @@
4173+fn:format-integer( 1, "㊀" ) eq "㊀"
4174
4175=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-one-05.xq'
4176--- test/rbkt/Queries/zorba/math/format_integer/format-integer-one-05.xq 1970-01-01 00:00:00 +0000
4177+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-one-05.xq 2013-04-01 03:35:28 +0000
4178@@ -0,0 +1,1 @@
4179+fn:format-integer( 10, "㊀" ) eq "㊉"
4180
4181=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-one-06.xq'
4182--- test/rbkt/Queries/zorba/math/format_integer/format-integer-one-06.xq 1970-01-01 00:00:00 +0000
4183+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-one-06.xq 2013-04-01 03:35:28 +0000
4184@@ -0,0 +1,1 @@
4185+fn:format-integer( 11, "㊀" ) eq "11"
4186
4187=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-w-1.xq'
4188--- test/rbkt/Queries/zorba/math/format_integer/format-integer-w-1.xq 1970-01-01 00:00:00 +0000
4189+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-w-1.xq 2013-04-01 03:35:28 +0000
4190@@ -0,0 +1,1 @@
4191+fn:format-integer( 42, "w", "en_US" ) eq "forty two"
4192
4193=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En1.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-w-2.xq'
4194--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En1.xq 2013-02-07 17:24:36 +0000
4195+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-w-2.xq 2013-04-01 03:35:28 +0000
4196@@ -1,1 +1,1 @@
4197-fn:format-integer(-1, "w")
4198\ No newline at end of file
4199+fn:format-integer( -1, "w", "en_US" ) eq "negative one"
4200
4201=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-w-3.xq'
4202--- test/rbkt/Queries/zorba/math/format_integer/format-integer-w-3.xq 1970-01-01 00:00:00 +0000
4203+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-w-3.xq 2013-04-01 03:35:28 +0000
4204@@ -0,0 +1,1 @@
4205+fn:format-integer( 1967, "w", "en_US" ) eq "one thousand nine hundred sixty seven"
4206
4207=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En6.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-w-4.xq'
4208--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En6.xq 2013-02-07 17:24:36 +0000
4209+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-w-4.xq 2013-04-01 03:35:28 +0000
4210@@ -1,1 +1,1 @@
4211-fn:format-integer(244, "Wo")
4212\ No newline at end of file
4213+fn:format-integer( 9223372036854775807, "w", "en_US" ) eq "nine quintillion two hundred twenty three quadrillion three hundred seventy two trillion thirty six billion eight hundred fifty four million seven hundred seventy five thousand eight hundred seven"
4214
4215=== renamed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En7.xq' => 'test/rbkt/Queries/zorba/math/format_integer/format-integer-w-5.xq'
4216--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En7.xq 2013-02-07 17:24:36 +0000
4217+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-w-5.xq 2013-04-01 03:35:28 +0000
4218@@ -1,1 +1,1 @@
4219-fn:format-integer(1100, "wo")
4220\ No newline at end of file
4221+fn:format-integer( 1100, "w;o" ) eq "one thousand one hundredth"
4222
4223=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-2.xq'
4224--- test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-2.xq 1970-01-01 00:00:00 +0000
4225+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-2.xq 2013-04-01 03:35:28 +0000
4226@@ -0,0 +1,1 @@
4227+fn:format-integer( 42, "w;o", "en_US" ) eq "forty second"
4228
4229=== added file 'test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-3.xq'
4230--- test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-3.xq 1970-01-01 00:00:00 +0000
4231+++ test/rbkt/Queries/zorba/math/format_integer/format-integer-wo-3.xq 2013-04-01 03:35:28 +0000
4232@@ -0,0 +1,1 @@
4233+fn:format-integer( -42, "w;o", "en_US" ) eq "negative forty second"
4234
4235=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ1.xq'
4236--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ1.xq 2013-02-07 17:24:36 +0000
4237+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ1.xq 1970-01-01 00:00:00 +0000
4238@@ -1,1 +0,0 @@
4239-fn:format-integer(-1, "ato")
4240\ No newline at end of file
4241
4242=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ6.xq'
4243--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ6.xq 2013-02-07 17:24:36 +0000
4244+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ6.xq 1970-01-01 00:00:00 +0000
4245@@ -1,1 +0,0 @@
4246-fn:format-integer((1+26)*26, "a")
4247\ No newline at end of file
4248
4249=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ7.xq'
4250--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ7.xq 2013-02-07 17:24:36 +0000
4251+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ7.xq 1970-01-01 00:00:00 +0000
4252@@ -1,1 +0,0 @@
4253-fn:format-integer((1+26)*26+1, "a")
4254\ No newline at end of file
4255
4256=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.spec'
4257--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.spec 2013-02-07 17:24:36 +0000
4258+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.spec 1970-01-01 00:00:00 +0000
4259@@ -1,1 +0,0 @@
4260-Error: http://www.w3.org/2005/xqt-errors:XPTY0004
4261
4262=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.xq'
4263--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.xq 2013-02-07 17:24:36 +0000
4264+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ8.xq 1970-01-01 00:00:00 +0000
4265@@ -1,1 +0,0 @@
4266-fn:format-integer(-1.2, "a")
4267\ No newline at end of file
4268
4269=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ9.xq'
4270--- test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ9.xq 2013-02-07 17:24:36 +0000
4271+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_AZ9.xq 1970-01-01 00:00:00 +0000
4272@@ -1,1 +0,0 @@
4273-fn:format-integer(0, "a")
4274\ No newline at end of file
4275
4276=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En3.xq'
4277--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En3.xq 2013-02-07 17:24:36 +0000
4278+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_En3.xq 1970-01-01 00:00:00 +0000
4279@@ -1,1 +0,0 @@
4280-fn:format-integer(101, "w")
4281\ No newline at end of file
4282
4283=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En4.xq'
4284--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En4.xq 2013-02-07 17:24:36 +0000
4285+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_En4.xq 1970-01-01 00:00:00 +0000
4286@@ -1,1 +0,0 @@
4287-fn:format-integer(-0, "w")
4288\ No newline at end of file
4289
4290=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.spec'
4291--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.spec 2013-02-07 17:24:36 +0000
4292+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.spec 1970-01-01 00:00:00 +0000
4293@@ -1,1 +0,0 @@
4294-Error: http://www.w3.org/2005/xqt-errors:FOAR0002
4295
4296=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.xq'
4297--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.xq 2013-02-07 17:24:36 +0000
4298+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_En5.xq 1970-01-01 00:00:00 +0000
4299@@ -1,1 +0,0 @@
4300-fn:format-integer(-123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789, "W")
4301\ No newline at end of file
4302
4303=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En8.xq'
4304--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En8.xq 2013-02-07 17:24:36 +0000
4305+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_En8.xq 1970-01-01 00:00:00 +0000
4306@@ -1,1 +0,0 @@
4307-fn:format-integer(-2, "wo")
4308\ No newline at end of file
4309
4310=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_En9.xq'
4311--- test/rbkt/Queries/zorba/math/format_integer/format_integer_En9.xq 2013-02-07 17:24:36 +0000
4312+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_En9.xq 1970-01-01 00:00:00 +0000
4313@@ -1,1 +0,0 @@
4314-fn:format-integer(10000000000000, "Ww")
4315\ No newline at end of file
4316
4317=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman3.xq'
4318--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman3.xq 2013-02-07 17:24:36 +0000
4319+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman3.xq 1970-01-01 00:00:00 +0000
4320@@ -1,1 +0,0 @@
4321-fn:format-integer(9, "i")
4322\ No newline at end of file
4323
4324=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman4.xq'
4325--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman4.xq 2013-02-07 17:24:36 +0000
4326+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman4.xq 1970-01-01 00:00:00 +0000
4327@@ -1,1 +0,0 @@
4328-fn:format-integer(29, "i")
4329\ No newline at end of file
4330
4331=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman5.xq'
4332--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman5.xq 2013-02-07 17:24:36 +0000
4333+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman5.xq 1970-01-01 00:00:00 +0000
4334@@ -1,1 +0,0 @@
4335-fn:format-integer(88, "i")
4336\ No newline at end of file
4337
4338=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman6.xq'
4339--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman6.xq 2013-02-07 17:24:36 +0000
4340+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman6.xq 1970-01-01 00:00:00 +0000
4341@@ -1,1 +0,0 @@
4342-fn:format-integer(2011, "i")
4343\ No newline at end of file
4344
4345=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman7.xq'
4346--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman7.xq 2013-02-07 17:24:36 +0000
4347+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman7.xq 1970-01-01 00:00:00 +0000
4348@@ -1,1 +0,0 @@
4349-fn:format-integer(777, "i", "it")
4350\ No newline at end of file
4351
4352=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.spec'
4353--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.spec 2013-02-07 17:24:36 +0000
4354+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.spec 1970-01-01 00:00:00 +0000
4355@@ -1,1 +0,0 @@
4356-Error: http://www.w3.org/2005/xqt-errors:FOFI0002
4357
4358=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.xq'
4359--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.xq 2013-02-07 17:24:36 +0000
4360+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman8.xq 1970-01-01 00:00:00 +0000
4361@@ -1,1 +0,0 @@
4362-fn:format-integer(3001, "i")
4363\ No newline at end of file
4364
4365=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman9.xq'
4366--- test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman9.xq 2013-02-07 17:24:36 +0000
4367+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_Roman9.xq 1970-01-01 00:00:00 +0000
4368@@ -1,1 +0,0 @@
4369-fn:format-integer(-0, "i")
4370\ No newline at end of file
4371
4372=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal10.xq'
4373--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal10.xq 2013-02-07 17:24:36 +0000
4374+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal10.xq 1970-01-01 00:00:00 +0000
4375@@ -1,1 +0,0 @@
4376-fn:format-integer(-121, "#oa")
4377\ No newline at end of file
4378
4379=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal2.xq'
4380--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal2.xq 2013-02-07 17:24:36 +0000
4381+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal2.xq 1970-01-01 00:00:00 +0000
4382@@ -1,1 +0,0 @@
4383-fn:format-integer(1, "#")
4384\ No newline at end of file
4385
4386=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal6.xq'
4387--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal6.xq 2013-02-07 17:24:36 +0000
4388+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal6.xq 1970-01-01 00:00:00 +0000
4389@@ -1,1 +0,0 @@
4390-fn:format-integer(1, "0-1-3")
4391\ No newline at end of file
4392
4393=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal7.xq'
4394--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal7.xq 2013-02-07 17:24:36 +0000
4395+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal7.xq 1970-01-01 00:00:00 +0000
4396@@ -1,1 +0,0 @@
4397-fn:format-integer(1234, "#-9-9-03")
4398\ No newline at end of file
4399
4400=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.spec'
4401--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.spec 2013-02-07 17:24:36 +0000
4402+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.spec 1970-01-01 00:00:00 +0000
4403@@ -1,1 +0,0 @@
4404-Error: http://www.w3.org/2005/xqt-errors:FOFI0002
4405
4406=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.xq'
4407--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.xq 2013-02-07 17:24:36 +0000
4408+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal8.xq 1970-01-01 00:00:00 +0000
4409@@ -1,1 +0,0 @@
4410-fn:format-integer(1, "3-")
4411\ No newline at end of file
4412
4413=== removed file 'test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal9.xq'
4414--- test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal9.xq 2013-02-07 17:24:36 +0000
4415+++ test/rbkt/Queries/zorba/math/format_integer/format_integer_decimal9.xq 1970-01-01 00:00:00 +0000
4416@@ -1,1 +0,0 @@
4417-fn:format-integer(123, "#oa")
4418\ No newline at end of file

Subscribers

People subscribed via source and target branches