Merge remote-tracking branch 'pakanek/master'

actorid
Marc Zinnschlag 12 years ago
commit c40e753ea9

3
.gitignore vendored

@ -18,3 +18,6 @@ CMakeLists.txt.user
*.swp *.swp
*.swo *.swo
*.kate-swp *.kate-swp
.cproject
.project
.settings/

@ -209,6 +209,7 @@ namespace MWScript
offset = script->mData.mNumShorts+script->mData.mNumLongs; offset = script->mData.mNumShorts+script->mData.mNumLongs;
size = script->mData.mNumFloats; size = script->mData.mNumFloats;
break;
default: default:

@ -1,6 +1,7 @@
#include "scanner.hpp" #include "scanner.hpp"
#include <cassert>
#include <cctype> #include <cctype>
#include <sstream> #include <sstream>
#include <algorithm> #include <algorithm>
@ -163,10 +164,9 @@ namespace Compiler
bool Scanner::scanInt (char c, Parser& parser, bool& cont) bool Scanner::scanInt (char c, Parser& parser, bool& cont)
{ {
assert(c != '\0');
std::string value; std::string value;
value += c; value += c;
bool empty = false;
bool error = false; bool error = false;
@ -175,7 +175,6 @@ namespace Compiler
if (std::isdigit (c)) if (std::isdigit (c))
{ {
value += c; value += c;
empty = false;
} }
else if (std::isalpha (c) || c=='_') else if (std::isalpha (c) || c=='_')
error = true; error = true;
@ -190,7 +189,7 @@ namespace Compiler
} }
} }
if (empty || error) if (error)
return false; return false;
TokenLoc loc (mLoc); TokenLoc loc (mLoc);

Loading…
Cancel
Save