comparison trunk/src/dil/doc/Doc.d @ 746:32a8ddd330f8

Using icompare() instead of toLower().
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 10 Feb 2008 02:14:08 +0100
parents 7299159c3a19
children 8caf18892c1b
comparison
equal deleted inserted replaced
745:7299159c3a19 746:32a8ddd330f8
8 import dil.ast.Node; 8 import dil.ast.Node;
9 import dil.lexer.Funcs; 9 import dil.lexer.Funcs;
10 import dil.Unicode; 10 import dil.Unicode;
11 import common; 11 import common;
12 12
13 import tango.text.Ascii : toLower; 13 import tango.text.Ascii : icompare;
14 14
15 class DDocComment 15 class DDocComment
16 { 16 {
17 Section[] sections; /// The sections of this comment. 17 Section[] sections; /// The sections of this comment.
18 Section summary; /// Optional summary section. 18 Section summary; /// Optional summary section.
39 39
40 /// Returns: true if "ditto" is the only text in this comment. 40 /// Returns: true if "ditto" is the only text in this comment.
41 bool isDitto() 41 bool isDitto()
42 { 42 {
43 if (summary && sections.length == 1 && 43 if (summary && sections.length == 1 &&
44 toLower(strip(summary.text.dup)) == "ditto") 44 icompare(strip(summary.text), "ditto") == 0)
45 return true; 45 return true;
46 return false; 46 return false;
47 } 47 }
48 48
49 // MacrosSection[] getMacros() 49 // MacrosSection[] getMacros()
66 return null; 66 return null;
67 } 67 }
68 68
69 /// Strips leading and trailing whitespace characters. 69 /// Strips leading and trailing whitespace characters.
70 /// Whitespace: ' ', '\t', '\v', '\f' and '\n' 70 /// Whitespace: ' ', '\t', '\v', '\f' and '\n'
71 /// Returns: a slice into str.
71 char[] strip(char[] str) 72 char[] strip(char[] str)
72 { 73 {
73 if (str.length == 0) 74 if (str.length == 0)
74 return null; 75 return null;
75 uint i; 76 uint i;
231 this.text = text; 232 this.text = text;
232 } 233 }
233 234
234 bool Is(char[] name2) 235 bool Is(char[] name2)
235 { 236 {
236 return toLower(name.dup) == name2; 237 return icompare(name, name2) == 0;
237 } 238 }
238 } 239 }
239 240
240 class ParamsSection : Section 241 class ParamsSection : Section
241 { 242 {