Quick and dirty bug fix for the parser to read GiNaC::lst again.
[ginac.git] / ginac / parser / default_reader.cpp
index 4f8c69c365d19be46be795cd7e003eb4e2a011ad..69b1a0c428d6ce632912e862d577dfff4b1d967f 100644 (file)
@@ -40,15 +40,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 +94,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 +120,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,