Merge lp:~paul-lucas/zorba/bug-1022762 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10923
Merged at revision: 10929
Proposed branch: lp:~paul-lucas/zorba/bug-1022762
Merge into: lp:zorba
Diff against target: 210 lines (+82/-97)
2 files modified
src/util/regex.cpp (+80/-97)
test/rbkt/Queries/CMakeLists.txt (+2/-0)
To merge this branch: bzr merge lp:~paul-lucas/zorba/bug-1022762
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+114280@code.launchpad.net

Commit message

Reverted previous "fix."

Description of the change

Reverted previous "fix."

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 :

The attempt to merge lp:~paul-lucas/zorba/bug-1022762 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job bug-1022762-2012-07-10T21-43-57.687Z is finished. The
  final status was:

  2 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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

The attempt to merge lp:~paul-lucas/zorba/bug-1022762 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job bug-1022762-2012-07-10T22-38-00.238Z is finished. The
  final status was:

  2 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

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-1022762-2012-07-11T02-21-58.677Z 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. Got: 1 Approve.

Revision history for this message
Matthias Brantner (matthias-brantner) :
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-1022762-2012-07-11T16-06-05.185Z 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 'src/util/regex.cpp'
2--- src/util/regex.cpp 2012-06-28 04:14:03 +0000
3+++ src/util/regex.cpp 2012-07-11 02:16:22 +0000
4@@ -124,103 +124,85 @@
5 }
6 got_backslash = false;
7
8- if ( in_char_class ) {
9- //
10- // When in a character class, only single-character escapes are
11- // permitted.
12- //
13- switch ( *xq_c ) {
14- case '(':
15- case ')':
16- case '*':
17- case '+':
18- case '-':
19- case '.':
20- case 'n': // newline
21- case 'r': // carriage return
22- case 't': // tab
23- case '[':
24- case '\\':
25- case ']':
26- case '^':
27- case '{':
28- case '|':
29- case '}':
30- *icu_re += '\\';
31- break;
32- default:
33- throw INVALID_RE_EXCEPTION( xq_re, ZED( BadRegexEscape_3 ), *xq_c );
34- }
35- } else {
36- switch ( *xq_c ) {
37- case 'c': // NameChar
38- *icu_re += "[" bs_c "]";
39- continue;
40- case 'C': // [^\c]
41- *icu_re += "[^" bs_c "]";
42- continue;
43- case 'i': // initial NameChar
44- *icu_re += "[" bs_i "]";
45- continue;
46- case 'I': // [^\i]
47- *icu_re += "[^" bs_i "]";
48- continue;
49- case '0':
50- case '1':
51- case '2':
52- case '3':
53- case '4':
54- case '5':
55- case '6':
56- case '7':
57- case '8':
58- case '9':
59- backref_no = *xq_c - '0';
60- if ( !backref_no ) // \0 is illegal
61- throw INVALID_RE_EXCEPTION( xq_re, ZED( BackRef0Illegal ) );
62- if ( in_char_class ) {
63- //
64- // XQuery 3.0 F&O 5.6.1: Within a character class expression,
65- // \ followed by a digit is invalid.
66- //
67- throw INVALID_RE_EXCEPTION(
68- xq_re, ZED( BackRefIllegalInCharClass )
69- );
70- }
71- in_backref = true;
72- // no break;
73- case '$':
74- case '(':
75- case ')':
76- case '*':
77- case '+':
78- case '-':
79- case '.':
80- case '?':
81- case 'd': // [0-9]
82- case 'D': // [^\d]
83- case 'n': // newline
84- case 'p': // category escape
85- case 'P': // [^\p]
86- case 'r': // carriage return
87- case 's': // whitespace
88- case 'S': // [^\s]
89- case 't': // tab
90- case 'w': // word char
91- case 'W': // [^\w]
92- case '[':
93- case '\\':
94- case ']':
95- case '^':
96- case '{':
97- case '|':
98- case '}':
99- *icu_re += '\\';
100- break;
101- default:
102- throw INVALID_RE_EXCEPTION( xq_re, ZED( BadRegexEscape_3 ), *xq_c );
103- }
104- } // if ( in_char_class )
105+ switch ( *xq_c ) {
106+
107+ ////////// Back-References ////////////////////////////////////////////
108+
109+ case '0':
110+ case '1':
111+ case '2':
112+ case '3':
113+ case '4':
114+ case '5':
115+ case '6':
116+ case '7':
117+ case '8':
118+ case '9':
119+ backref_no = *xq_c - '0';
120+ if ( !backref_no ) // \0 is illegal
121+ throw INVALID_RE_EXCEPTION( xq_re, ZED( BackRef0Illegal ) );
122+ if ( in_char_class ) {
123+ //
124+ // XQuery 3.0 F&O 5.6.1: Within a character class expression,
125+ // \ followed by a digit is invalid.
126+ //
127+ throw INVALID_RE_EXCEPTION(
128+ xq_re, ZED( BackRefIllegalInCharClass )
129+ );
130+ }
131+ in_backref = true;
132+ // no break;
133+
134+ ////////// Single Character Escapes ///////////////////////////////////
135+
136+ case '$': // added in XQuery 3.0 F&O 5.6.1
137+ case '(':
138+ case ')':
139+ case '*':
140+ case '+':
141+ case '-':
142+ case '.':
143+ case '?':
144+ case '[':
145+ case '\\':
146+ case ']':
147+ case '^':
148+ case 'n': // newline
149+ case 'r': // carriage return
150+ case 't': // tab
151+ case '{':
152+ case '|':
153+ case '}':
154+ // no break;
155+
156+ ////////// Multi-Character & Category Escapes /////////////////////////
157+
158+ case 'd': // [0-9]
159+ case 'D': // [^\d]
160+ case 'p': // category escape
161+ case 'P': // [^\p]
162+ case 's': // whitespace
163+ case 'S': // [^\s]
164+ case 'w': // word char
165+ case 'W': // [^\w]
166+ *icu_re += '\\';
167+ break;
168+ case 'c': // NameChar
169+ *icu_re += "[" bs_c "]";
170+ continue;
171+ case 'C': // [^\c]
172+ *icu_re += "[^" bs_c "]";
173+ continue;
174+ case 'i': // initial NameChar
175+ *icu_re += "[" bs_i "]";
176+ continue;
177+ case 'I': // [^\i]
178+ *icu_re += "[^" bs_i "]";
179+ continue;
180+
181+ default:
182+ throw INVALID_RE_EXCEPTION( xq_re, ZED( BadRegexEscape_3 ), *xq_c );
183+ }
184 } else {
185 if ( in_backref ) {
186 //
187@@ -300,6 +282,7 @@
188 is_first_char = true;
189 goto append;
190 }
191+ break;
192 default:
193 if ( x_flag && ascii::is_space( *xq_c ) ) {
194 if ( !in_char_class )
195
196=== modified file 'test/rbkt/Queries/CMakeLists.txt'
197--- test/rbkt/Queries/CMakeLists.txt 2012-07-09 20:45:24 +0000
198+++ test/rbkt/Queries/CMakeLists.txt 2012-07-11 02:16:22 +0000
199@@ -552,9 +552,11 @@
200 IF ( ${ICU_VERSION} VERSION_LESS 4.0.0 )
201 EXPECTED_FAILURE(test/rbkt/zorba/string/Regex/regex_m40 866874)
202 EXPECTED_FAILURE(test/rbkt/zorba/string/Regex/regex_m41 866874)
203+ EXPECTED_FAILURE(test/rbkt/zorba/string/Regex/regex_err17 1023168)
204 ELSE ( ${ICU_VERSION} VERSION_LESS 4.0.0 )
205 EXPECTED_FAILURE(test/rbkt/zorba/string/Regex/regex_err10 994610)
206 EXPECTED_FAILURE(test/rbkt/zorba/string/Regex/regex_err15 866874)
207+ EXPECTED_FAILURE(test/rbkt/zorba/string/Regex/regex_err16 1023168)
208 ENDIF ( ${ICU_VERSION} VERSION_LESS 4.0.0 )
209 EXPECTED_FAILURE(test/rbkt/zorba/string/Regex/regex_m11 866874)
210 ENDIF(NOT ZORBA_NO_ICU)

Subscribers

People subscribed via source and target branches