- added support for rounded rectangles for use in the menu
[supertux.git] / src / lisp / lexer.cpp
index de3243e..05b52bc 100644 (file)
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
 #include <config.h>
 
 #include <sstream>
+#include <cstring>
 #include <stdexcept>
 #include <iostream>
 
@@ -40,7 +40,7 @@ Lexer::Lexer(std::istream& newstream)
     c = 0;
     bufend = 0;
     nextChar();
-  } catch(EOFException& e) {
+  } catch(EOFException& ) {
   }
 }
 
@@ -109,6 +109,8 @@ Lexer::getNextToken()
             nextChar();
             if(*c == '"')
               break;
+            else if (*c == '\r') // XXX this breaks with pure \r EOL
+              continue;
             else if(*c == '\n')
               linenumber++;
             else if(*c == '\\') {
@@ -129,7 +131,7 @@ Lexer::getNextToken()
         } catch(EOFException& ) {
           std::stringstream msg;
           msg << "Parse error in line " << startline << ": "
-            << "EOF while parsing string.";
+              << "EOF while parsing string.";
           throw std::runtime_error(msg.str());
         }
         nextChar();