X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=tools%2Ftilemanager%2FLexer.cs;h=601d53d75cd1aa571e2c4f6f65db4e3c6dd6537a;hb=f406067af6cbeb0a638078fe1d386d092583909c;hp=28df77a83c09e09c9bf90208ec83bda84d045599;hpb=66979214800e01bb345f9016a87e15d30251b99d;p=supertux.git diff --git a/tools/tilemanager/Lexer.cs b/tools/tilemanager/Lexer.cs index 28df77a83..601d53d75 100644 --- a/tools/tilemanager/Lexer.cs +++ b/tools/tilemanager/Lexer.cs @@ -1,3 +1,4 @@ +// $Id$ using System; using System.Text; using System.IO; @@ -13,7 +14,7 @@ public class Lexer { public class EOFException : Exception { }; - + public enum TokenType { EOF, OPEN_PAREN, @@ -99,7 +100,7 @@ public class Lexer { if(TokenString == "f") return TokenType.FALSE; - throw new Exception("Unknown constant '" + throw new Exception("Unknown constant '" + TokenString + "'"); default: if(Char.IsDigit(c) || c == '-') { @@ -119,7 +120,7 @@ public class Lexer { NextChar(); } while(!Char.IsWhiteSpace(c) && c != '\"' && c != '(' && c != ')' && c != ';'); - + if(have_nondigits || !have_digits || have_floating_point > 1) return TokenType.SYMBOL; @@ -133,11 +134,11 @@ public class Lexer { NextChar(); } while(!Char.IsWhiteSpace(c) && c != '\"' && c != '(' && c != ')' && c != ';'); - + return TokenType.SYMBOL; } } - } catch(EOFException e) { + } catch(EOFException) { return TokenType.EOF; } }