Mercurial > projects > dil
changeset 52:f65a83c27638
- Fixed the raw string literal scanner. Newlines weren't copied to the buffer. Converting LS and PS to '\n' as well.
- Removed \x0 and \x1A from ptable.
author | aziz |
---|---|
date | Wed, 27 Jun 2007 17:18:02 +0000 |
parents | cadd2bfe686c |
children | 1786c2825491 |
files | trunk/src/Lexer.d trunk/src/format.css |
diffstat | 2 files changed, 12 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/Lexer.d Wed Jun 27 16:43:00 2007 +0000 +++ b/trunk/src/Lexer.d Wed Jun 27 17:18:02 2007 +0000 @@ -13,8 +13,8 @@ /// ASCII character properties table. static const int ptable[256] = [ - 0x5c00, 0, 0, 0, 0, 0, 0, 0, 0,32, 0,32,32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x5c00, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,32, 0,32,32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0x2200, 0, 0, 0, 0, 0x2700, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 0, 0, 0, 0, 0, 0x3f00, 0,12,12,12,12,12,12, 8, 8, 8, 8, 8, 8, 8, 8, 8, @@ -80,7 +80,7 @@ p['\''] |= 39 << 8; p['"'] |= 34 << 8; p['?'] |= 63 << 8; - p['\\'] |= p[0] = p[26] = 92 << 8; + p['\\'] |= 92 << 8; p['a'] |= 7 << 8; p['b'] |= 8 << 8; p['f'] |= 12 << 8; @@ -837,7 +837,7 @@ c = '\n'; // Convert '\r' and '\r\n' to '\n' case '\n': ++loc; - continue; + break; case '`': case '"': if (c == delim) @@ -853,11 +853,9 @@ case LS[0]: if (p[1] == LS[1] && (p[2] == LS[2] || p[2] == PS[2])) { - // TODO: convert LS or PS to \n? - buffer ~= p[0..3]; - p += 2; + c = '\n'; + ++p; ++p; ++loc; - continue; } break; case 0, _Z_:
--- a/trunk/src/format.css Wed Jun 27 16:43:00 2007 +0000 +++ b/trunk/src/format.css Wed Jun 27 17:18:02 2007 +0000 @@ -5,7 +5,12 @@ font-family: Monospace; font-size: 0.8em; } -compilerinfo { white-space: normal; border: 1px solid #A22; padding: 0.5em; margin: 1em;} +compilerinfo { + white-space: normal; + border: 1px solid #A22; + padding: 0.5em; + margin: 1em; +} compilerinfo error { display: block; } k { color: darkblue; font-weight: bold; } c[c=lc], c[c=bc] { color: green; }