X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginsh%2Fginsh_parser.ypp;h=bb62ed051b9e55530d4173ee5d837ed35d7b9b1b;hp=88aa9843ab09dd9b72b7343c2d582fc4dc6a54f4;hb=faf8c206bdcd01eee758103d56b83a634f787e7a;hpb=8bd8cedd086aeaf08630d5357af37151e1d06d06 diff --git a/ginsh/ginsh_parser.ypp b/ginsh/ginsh_parser.ypp index 88aa9843..bb62ed05 100644 --- a/ginsh/ginsh_parser.ypp +++ b/ginsh/ginsh_parser.ypp @@ -1,10 +1,10 @@ -/** @file ginsh_parser.yy +/** @file ginsh_parser.ypp * * Input grammar definition for ginsh. * This file must be processed with yacc/bison. */ /* - * GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -218,8 +218,8 @@ line : ';' cout << "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n"; cout << "details.\n"; cout << "You should have received a copy of the GNU General Public License along with\n"; - cout << "this program. If not, write to the Free Software Foundation, 675 Mass Ave,\n"; - cout << "Cambridge, MA 02139, USA.\n"; + cout << "this program. If not, write to the Free Software Foundation,\n"; + cout << "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"; } | T_XYZZY {cout << "Nothing happens.\n";} | T_INVENTORY {cout << "You're not carrying anything.\n";} @@ -431,8 +431,8 @@ static ex f_find(const exprseq &e) exset found; e[0].find(e[1], found); lst l; - for (exset::const_iterator i = found.begin(); i != found.end(); ++i) - l.append(*i); + for (auto & i : found) + l.append(i); return l; } @@ -486,8 +486,8 @@ static ex f_match(const exprseq &e) exmap repls; if (e[0].match(e[1], repls)) { lst repl_lst; - for (exmap::const_iterator i = repls.begin(); i != repls.end(); ++i) - repl_lst.append(relational(i->first, i->second, relational::equal)); + for (auto & i : repls) + repl_lst.append(relational(i.first, i.second, relational::equal)); return repl_lst; } throw std::runtime_error("FAIL"); @@ -736,12 +736,9 @@ static ex f_ginac_function(const exprseq &es, int serial) namespace GiNaC { static void ginsh_get_ginac_functions(void) { - vector gfv = function::get_registered_functions(); - vector::const_iterator i = gfv.begin(), end = gfv.end(); unsigned serial = 0; - while (i != end) { - fcns.insert(make_pair(i->get_name(), fcn_desc(f_ginac_function, i->get_nparams(), serial))); - ++i; + for (auto & i : function::get_registered_functions()) { + fcns.insert(make_pair(i.get_name(), fcn_desc(f_ginac_function, i.get_nparams(), serial))); serial++; } } @@ -902,7 +899,7 @@ static void ginsh_readline_init(char* name) void greeting(void) { cout << "ginsh - GiNaC Interactive Shell (GiNaC V" << GINACLIB_VERSION << ")" << endl; - cout << " __, _______ Copyright (C) 1999-2011 Johannes Gutenberg University Mainz,\n" + cout << " __, _______ Copyright (C) 1999-2015 Johannes Gutenberg University Mainz,\n" << " (__) * | Germany. This is free software with ABSOLUTELY NO WARRANTY.\n" << " ._) i N a C | You are welcome to redistribute it under certain conditions.\n" << "<-------------' For details type `warranty;'.\n" << endl;