X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=tools%2Ftilemanager%2FLexer.cs;h=bbbd397aaa86b3c92263356683af42f5e79add2e;hb=7af002362d894832570cffcda1afbd5bafee06eb;hp=28df77a83c09e09c9bf90208ec83bda84d045599;hpb=6f8515e10faeee9582a7ec7462c3fda2def49c9c;p=supertux.git diff --git a/tools/tilemanager/Lexer.cs b/tools/tilemanager/Lexer.cs index 28df77a83..bbbd397aa 100644 --- a/tools/tilemanager/Lexer.cs +++ b/tools/tilemanager/Lexer.cs @@ -13,7 +13,7 @@ public class Lexer { public class EOFException : Exception { }; - + public enum TokenType { EOF, OPEN_PAREN, @@ -99,7 +99,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 +119,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,7 +133,7 @@ public class Lexer { NextChar(); } while(!Char.IsWhiteSpace(c) && c != '\"' && c != '(' && c != ')' && c != ';'); - + return TokenType.SYMBOL; } }