From 0d0159f70b0f3b23d6a4187d43167ded6b104e0f Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 2 Nov 2020 09:03:05 +0200 Subject: Support for strings in the AST interpreter --- JSImpl/src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'JSImpl/src/main.cpp') diff --git a/JSImpl/src/main.cpp b/JSImpl/src/main.cpp index 6ed1122..06421a7 100644 --- a/JSImpl/src/main.cpp +++ b/JSImpl/src/main.cpp @@ -38,7 +38,11 @@ class InterpreterPrinter : public ASTInterpreter::Printer public: virtual void PrintVariable(const char* name, double value) override { - std::cout << name << ": " << value << std::endl; + std::cout << name << ": number : " << value << std::endl; + } + virtual void PrintVariable(const char* name, const IPLString& value) override + { + std::cout << name << ": string : " << value << std::endl; } }; -- cgit v1.3.1-23-gd82d