projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New grow and skid sounds from remaxim
[supertux.git]
/
tools
/
tilemanager
/
Lexer.cs
diff --git
a/tools/tilemanager/Lexer.cs
b/tools/tilemanager/Lexer.cs
index
28df77a
..
601d53d
100644
(file)
--- a/
tools/tilemanager/Lexer.cs
+++ b/
tools/tilemanager/Lexer.cs
@@
-1,3
+1,4
@@
+// $Id$
using System;
using System.Text;
using System.IO;
using System;
using System.Text;
using System.IO;
@@
-13,7
+14,7
@@
public class Lexer {
public class EOFException : Exception {
};
public class EOFException : Exception {
};
-
+
public enum TokenType {
EOF,
OPEN_PAREN,
public enum TokenType {
EOF,
OPEN_PAREN,
@@
-99,7
+100,7
@@
public class Lexer {
if(TokenString == "f")
return TokenType.FALSE;
if(TokenString == "f")
return TokenType.FALSE;
- throw new Exception("Unknown constant '"
+ throw new Exception("Unknown constant '"
+ TokenString + "'");
default:
if(Char.IsDigit(c) || c == '-') {
+ TokenString + "'");
default:
if(Char.IsDigit(c) || c == '-') {
@@
-119,7
+120,7
@@
public class Lexer {
NextChar();
} while(!Char.IsWhiteSpace(c) && c != '\"' && c != '('
&& c != ')' && c != ';');
NextChar();
} while(!Char.IsWhiteSpace(c) && c != '\"' && c != '('
&& c != ')' && c != ';');
-
+
if(have_nondigits || !have_digits
|| have_floating_point > 1)
return TokenType.SYMBOL;
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 != ';');
NextChar();
} while(!Char.IsWhiteSpace(c) && c != '\"' && c != '('
&& c != ')' && c != ';');
-
+
return TokenType.SYMBOL;
}
}
return TokenType.SYMBOL;
}
}
- } catch(EOFException
e
) {
+ } catch(EOFException) {
return TokenType.EOF;
}
}
return TokenType.EOF;
}
}