made local variable names case-insensitive

This commit is contained in:
Marc Zinnschlag 2010-06-29 08:09:12 +02:00
parent c6a37b2e18
commit 10cb9d3dab
3 changed files with 22 additions and 6 deletions

View file

@ -1,6 +1,9 @@
#include "parser.hpp"
#include <cctype>
#include <algorithm>
#include "errorhandler.hpp"
#include "exception.hpp"
@ -50,6 +53,16 @@ namespace Compiler
return mContext;
}
std::string Parser::toLower (const std::string& name)
{
std::string lowerCase;
std::transform (name.begin(), name.end(), std::back_inserter (lowerCase),
(int(*)(int)) std::tolower);
return lowerCase;
}
Parser::Parser (ErrorHandler& errorHandler, Context& context)
: mErrorHandler (errorHandler), mContext (context)
{}