mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 00:30:46 +01:00
Print symbol names in the debug.
Also change the prototype to take a const Expression *, I forgot to change the code there in the const commit. Change-Id: Iea7b9d9a450533bbae8d9003482ee7bd5f442cd2
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#include <poincare/expression.h>
|
||||
#include <poincare/context.h>
|
||||
#include <poincare/expression.h>
|
||||
#include <poincare/symbol.h>
|
||||
#include <iostream>
|
||||
|
||||
void print_expression(Expression * e, int indentationLevel) {
|
||||
void print_expression(const Expression * e, int indentationLevel) {
|
||||
if (indentationLevel>0) {
|
||||
for (int i=0; i<indentationLevel-1; i++) {
|
||||
std::cout << " ";
|
||||
@@ -41,7 +42,7 @@ void print_expression(Expression * e, int indentationLevel) {
|
||||
std::cout << "Subtraction";
|
||||
break;
|
||||
case Expression::Type::Symbol:
|
||||
std::cout << "Symbol";
|
||||
std::cout << "Symbol(" << ((Symbol*)e)->name() << ")";
|
||||
break;
|
||||
case Expression::Type::Tangent:
|
||||
std::cout << "Tangent";
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#include <poincare/expression.h>
|
||||
|
||||
void print_expression(Expression * e, int indentationLevel = 0);
|
||||
void print_expression(const Expression * e, int indentationLevel = 0);
|
||||
|
||||
Reference in New Issue
Block a user