Mercurial > projects > dil
comparison trunk/src/dil/lexer/Funcs.d @ 786:3b34f6a95a27
Added and revised documenation comments.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sun, 24 Feb 2008 02:41:11 +0100 |
parents | 5e3ef1b2011c |
children |
comparison
equal
deleted
inserted
replaced
785:57ef69eced96 | 786:3b34f6a95a27 |
---|---|
3 License: GPL3 | 3 License: GPL3 |
4 +/ | 4 +/ |
5 module dil.lexer.Funcs; | 5 module dil.lexer.Funcs; |
6 | 6 |
7 const char[3] LS = \u2028; /// Unicode line separator. | 7 const char[3] LS = \u2028; /// Unicode line separator. |
8 const dchar LSd = 0x2028; /// ditto | |
8 const char[3] PS = \u2029; /// Unicode paragraph separator. | 9 const char[3] PS = \u2029; /// Unicode paragraph separator. |
9 const dchar LSd = 0x2028; | 10 const dchar PSd = 0x2029; /// ditto |
10 const dchar PSd = 0x2029; | |
11 static assert(LS[0] == PS[0] && LS[1] == PS[1]); | 11 static assert(LS[0] == PS[0] && LS[1] == PS[1]); |
12 | 12 |
13 const uint _Z_ = 26; /// Control+Z | 13 const dchar _Z_ = 26; /// Control+Z. |
14 | 14 |
15 /// Returns: true if d is a Unicode line or paragraph separator. | 15 /// Returns: true if d is a Unicode line or paragraph separator. |
16 bool isUnicodeNewlineChar(dchar d) | 16 bool isUnicodeNewlineChar(dchar d) |
17 { | 17 { |
18 return d == LSd || d == PSd; | 18 return d == LSd || d == PSd; |
91 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 91 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
92 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 92 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | 93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
94 ]; | 94 ]; |
95 | 95 |
96 /// Enumeration of character property flags. | |
96 enum CProperty | 97 enum CProperty |
97 { | 98 { |
98 Octal = 1, | 99 Octal = 1, /// 0-7 |
99 Digit = 1<<1, | 100 Digit = 1<<1, /// 0-9 |
100 Hex = 1<<2, | 101 Hex = 1<<2, /// 0-9a-fA-F |
101 Alpha = 1<<3, | 102 Alpha = 1<<3, /// a-zA-Z |
102 Underscore = 1<<4, | 103 Underscore = 1<<4, /// _ |
103 Whitespace = 1<<5 | 104 Whitespace = 1<<5 /// ' ' \t \v \f |
104 } | 105 } |
105 | 106 |
106 const uint EVMask = 0xFF00; // Bit mask for escape value | 107 const uint EVMask = 0xFF00; // Bit mask for escape value. |
107 | 108 |
108 private alias CProperty CP; | 109 private alias CProperty CP; |
109 /// Returns: true if c is an octal digit. | 110 /// Returns: true if c is an octal digit. |
110 int isoctal(char c) { return ptable[c] & CP.Octal; } | 111 int isoctal(char c) { return ptable[c] & CP.Octal; } |
111 /// Returns: true if c is a decimal digit. | 112 /// Returns: true if c is a decimal digit. |