Mercurial > projects > dil
comparison src/dil/lexer/Lexer.d @ 818:372fa4fbbb1d
Added error messages and applied fixes.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Thu, 13 Mar 2008 02:21:26 +0100 |
parents | 49e32b5bc161 |
children | d659f7aa055c |
comparison
equal
deleted
inserted
replaced
817:e6fb7ed87d3a | 818:372fa4fbbb1d |
---|---|
2542 return false; | 2542 return false; |
2543 } while (idx < str.length) | 2543 } while (idx < str.length) |
2544 return true; | 2544 return true; |
2545 } | 2545 } |
2546 | 2546 |
2547 /// Returns true if str is a keyword or a special token (__FILE__, __LINE__ etc.) | 2547 /// Returns true if str is a keyword or |
2548 /// a special token (__FILE__, __LINE__ etc.) | |
2548 static bool isReservedIdentifier(char[] str) | 2549 static bool isReservedIdentifier(char[] str) |
2549 { | 2550 { |
2551 if (str.length == 0) | |
2552 return false; | |
2550 auto id = IdTable.inStatic(str); | 2553 auto id = IdTable.inStatic(str); |
2551 if (id is null || id.kind == TOK.Identifier) | 2554 if (id is null || id.kind == TOK.Identifier) |
2552 return false; // str is not in the table or a normal identifier. | 2555 return false; // str is not in the table or a normal identifier. |
2553 return true; | 2556 return true; |
2554 } | 2557 } |