X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flisp%2Flist_iterator.cpp;h=de46fcaa5fab6bcbd6d9f9b567e7d7bd10687e90;hb=3da5eb5cc8f63053aaebb48cb2fffbed66f30d47;hp=1850113b8eb299cb61fed8978dfad11dfc45699f;hpb=c0093d25093395cb62fc2526ab42be65a9f015b8;p=supertux.git diff --git a/src/lisp/list_iterator.cpp b/src/lisp/list_iterator.cpp index 1850113b8..de46fcaa5 100644 --- a/src/lisp/list_iterator.cpp +++ b/src/lisp/list_iterator.cpp @@ -1,7 +1,7 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2005 Matthias Braun +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,15 +12,14 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // 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. +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#include "list_iterator.h" +#include "list_iterator.hpp" #include namespace lisp @@ -39,12 +38,14 @@ ListIterator::next() const lisp::Lisp* child = cur->get_car(); if(!child) - throw new std::runtime_error("child is 0 in list entry"); + throw std::runtime_error("child is 0 in list entry"); if(child->get_type() != lisp::Lisp::TYPE_CONS) - throw new std::runtime_error("Expected CONS"); + throw std::runtime_error("Expected CONS"); const lisp::Lisp* name = child->get_car(); - if(!name || name->get_type() != lisp::Lisp::TYPE_SYMBOL) - throw new std::runtime_error("Expected symbol"); + if(!name || ( + name->get_type() != lisp::Lisp::TYPE_SYMBOL + && name->get_type() != lisp::Lisp::TYPE_STRING)) + throw std::runtime_error("Expected symbol"); name->get(current_item); current_lisp = child->get_cdr();