]> www.ginac.de Git - ginac.git/blobdiff - ginsh/ginsh_parser.ypp
[BUGFIX] Fix crash in parser.
[ginac.git] / ginsh / ginsh_parser.ypp
index 0a056c4d5cac11f546ca05e21100289322e9b7c9..a142f4bba25109c139b50b33284dac2d8afd9e6d 100644 (file)
@@ -4,7 +4,7 @@
  *  This file must be processed with yacc/bison. */
 
 /*
- *  GiNaC Copyright (C) 1999-2020 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2024 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
@@ -530,6 +530,12 @@ static ex f_series(const exprseq &e)
        return e[0].series(e[1], ex_to<numeric>(e[2]).to_int());
 }
 
+static ex f_series_to_poly(const exprseq &e)
+{
+       CHECK_ARG(0, pseries, series_to_poly);
+       return series_to_poly(ex_to<pseries>(e[0]));
+}
+
 static ex f_sprem(const exprseq &e)
 {
        return sprem(e[0], e[1], e[2]);
@@ -541,6 +547,11 @@ static ex f_sqrfree2(const exprseq &e)
        return sqrfree(e[0], ex_to<lst>(e[1]));
 }
 
+static ex f_sqrfree_parfrac(const exprseq &e)
+{
+       return sqrfree_parfrac(e[0], ex_to<symbol>(e[1]));
+}
+
 static ex f_subs3(const exprseq &e)
 {
        CHECK_ARG(1, lst, subs);
@@ -737,9 +748,11 @@ static const fcn_init builtin_fcns[] = {
        {"rem", f_rem, 3},
        {"resultant", f_resultant, 3},
        {"series", f_series, 3},
+       {"series_to_poly", f_series_to_poly, 1},
        {"sprem", f_sprem, 3},
        {"sqrfree", f_sqrfree1, 1},
        {"sqrfree", f_sqrfree2, 2},
+       {"sqrfree_parfrac", f_sqrfree_parfrac, 2},
        {"sqrt", f_sqrt, 1},
        {"subs", f_subs2, 2},
        {"subs", f_subs3, 3},
@@ -1000,7 +1013,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-2020 Johannes Gutenberg University Mainz,\n"
+    cout << "  __,  _______  Copyright (C) 1999-2024 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;