]> www.ginac.de Git - ginac.git/blobdiff - ginac/parser/default_reader.cpp
[bugfix] Always #include <lst.h> before using lst. Fixes build error on MinGW.
[ginac.git] / ginac / parser / default_reader.cpp
index 4f8c69c365d19be46be795cd7e003eb4e2a011ad..5ccec4dd3d402f988d19d21f4ea15a819401b5e9 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "parse_context.h"
 #include "power.h"
+#include "lst.h"
 #include "operators.h"
 #include "inifcns.h"
 #ifdef HAVE_CONFIG_H
@@ -40,15 +41,22 @@ static ex sqrt_reader(const exvector& ev)
 {
        return GiNaC::sqrt(ev[0]);
 }
+
 static ex pow_reader(const exvector& ev)
 {
        return GiNaC::pow(ev[0], ev[1]);
 }
+
 static ex power_reader(const exvector& ev)
 {
        return GiNaC::power(ev[0], ev[1]);
 }
 
+static ex lst_reader(const exvector& ev)
+{
+       return GiNaC::lst(ev.begin(), ev.end());
+}
+
 
 // function::registered_functions() is protected, but we need to access it
 // TODO: add a proper const method to the `function' class, so we don't
@@ -87,6 +95,7 @@ const prototype_table& get_default_reader()
                reader[make_pair("sqrt", 1)] = sqrt_reader;
                reader[make_pair("pow", 2)] = pow_reader;
                reader[make_pair("power", 2)] = power_reader;
+               reader[make_pair("lst", 0)] = lst_reader;
                std::vector<function_options>::const_iterator it =
                        registered_functions_hack::get_registered_functions().begin();
                std::vector<function_options>::const_iterator end =
@@ -112,6 +121,7 @@ const prototype_table& get_builtin_reader()
                reader[make_pair("sqrt", 1)] = sqrt_reader;
                reader[make_pair("pow", 2)] = pow_reader;
                reader[make_pair("power", 2)] = power_reader;
+               reader[make_pair("lst", 0)] = lst_reader;
                enum {
                        log,
                        exp,