Mercurial > projects > ddmd
comparison dmd/Escape.d @ 151:766e6dc390e1
+ Escape.escapeChar()
author | Trass3r |
---|---|
date | Wed, 15 Sep 2010 02:47:24 +0200 |
parents | 10317f0c89a5 |
children |
comparison
equal
deleted
inserted
replaced
150:a79be6756969 | 151:766e6dc390e1 |
---|---|
1 module dmd.Escape; | 1 module dmd.Escape; |
2 | 2 |
3 struct Escape | 3 struct Escape |
4 { | 4 { |
5 const(char)* strings[256]; | 5 string[256] strings; |
6 | 6 |
7 static const(char)* escapeChar(uint c) | 7 /*************************************** |
8 * Find character string to replace c with. | |
9 */ | |
10 static string escapeChar(char c) | |
8 { | 11 { |
9 assert(false); | 12 switch (c) |
13 { | |
14 case '<': | |
15 return "<"; | |
16 case '>': | |
17 return ">"; | |
18 case '&': | |
19 return "&"; | |
20 default: | |
21 return null; | |
22 } | |
10 } | 23 } |
11 } | 24 } |