Changeset 1549
- Timestamp:
- 05/24/10 04:26:55 (15 years ago)
- Files:
-
- trunk/docsrc/changelog.dd (modified) (1 diff)
- trunk/phobos/std/xml.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docsrc/changelog.dd
r1547 r1549 5 5 6 6 $(VERSION 047, May 9, 2010, =================================================, 7 7 8 8 $(WHATSNEW 9 9 $(LI std.functional: toDelegate now accepts callable(function pointers, delegates and objects implement opCall) ) 10 10 $(LI std.traits: Added templates to get compile-time information about functions.) 11 11 $(LI std.typecons: Added tie and AutoImplement.) 12 12 ) 13 13 $(BUGSFIXED 14 14 $(LI $(BUGZILLA 2835): std.socket.TcpSocket doesn't actually connect) 15 $(LI $(BUGZILLA 3088): std.xml.check() fails on xml comments) 15 16 $(LI $(BUGZILLA 3200): std.xml doesn't follow spec for Tag.text) 16 17 $(LI $(BUGZILLA 3873): std.range.repeat should have popBack defined) 17 18 $(LI $(BUGZILLA 3880): std.regex functions with const/immutable Regex object) 18 19 $(LI $(BUGZILLA 4109): writeln doesn't work with empty static array) 19 20 $(LI $(BUGZILLA 4202): Changset 1517 doesn't compile) 20 21 $(LI $(BUGZILLA 4228): std.array.replace contains 2 bugs) 21 22 ) 22 23 ) 23 24 24 25 <div id=version> trunk/phobos/std/xml.d
r1544 r1549 2147 2147 } 2148 2148 } 2149 2149 2150 2150 void checkComment(ref string s) // rule 15 2151 2151 { 2152 2152 mixin Check!("Comment"); 2153 2153 2154 2154 try { checkLiteral("<!--",s); } catch(Err e) { fail(e); } 2155 2155 int n = s.indexOf("--"); 2156 2156 if (n == -1) fail("unterminated comment"); 2157 s = s[ 0..n];2157 s = s[n..$]; 2158 2158 try { checkLiteral("-->",s); } catch(Err e) { fail(e); } 2159 2159 } 2160 2160 2161 2161 void checkPI(ref string s) // rule 16 2162 2162 { 2163 2163 mixin Check!("PI"); 2164 2164 2165 2165 try 2166 2166 { 2167 2167 checkLiteral("<?",s); … … 2611 2611 ]"); 2612 2612 assert(false); 2613 2613 } 2614 2614 catch(CheckException e) 2615 2615 { 2616 2616 int n = e.toString().indexOf("end tag name \"genres\" differs" 2617 2617 " from start tag name \"genre\""); 2618 2618 assert(n != -1); 2619 2619 } 2620 2620 } 2621 } 2622 2623 unittest 2624 { 2625 string s = q"EOS 2626 <?xml version="1.0"?> 2627 <set> 2628 <one>A</one> 2629 <!-- comment --> 2630 <two>B</two> 2631 </set> 2632 EOS"; 2633 try 2634 { 2635 check(s); 2636 } 2637 catch (CheckException e) 2638 { 2639 assert(0, e.toString()); 2640 } 2621 2641 } 2622 2642 2623 2643 unittest 2624 2644 { 2625 2645 string s = q"EOS 2626 2646 <?xml version="1.0" encoding="utf-8"?> <Tests> 2627 2647 <Test thing="What & Up">What & Up Second</Test> 2628 2648 </Tests> 2629 2649 EOS"; 2630 2650 auto xml = new DocumentParser(s);
