Mercurial > projects > dil
diff trunk/src/Lexer.d @ 20:d6adfbd7c513
- Added code for parsing braces.
author | aziz |
---|---|
date | Sat, 23 Jun 2007 22:31:02 +0000 |
parents | f85832f9f24e |
children | c785c122e4e6 |
line wrap: on
line diff
--- a/trunk/src/Lexer.d Sat Jun 23 22:08:04 2007 +0000 +++ b/trunk/src/Lexer.d Sat Jun 23 22:31:02 2007 +0000 @@ -259,6 +259,32 @@ if (c == '\'') return scanCharacterLiteral(t); + switch(c) + { + case '(': + t.type = TOK.LParen; + goto Lcommon; + case ')': + t.type = TOK.RParen; + goto Lcommon; + case '[': + t.type = TOK.LBracket; + goto Lcommon; + case ']': + t.type = TOK.RBracket; + goto Lcommon; + case '{': + t.type = TOK.LBrace; + goto Lcommon; + case '}': + t.type = TOK.RBrace; + Lcommon: + ++p; + t.end = p; + return; + default: + } + if (c & 128 && isUniAlpha(decodeUTF())) goto Lidentifier; c = *++p;