From b4bb5eb1affcf1bebc779fbfba92cbdf7fe38c8d Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Tue, 27 Oct 2020 19:38:20 +0200 Subject: Fix printing of numbers in ast printer. --- JSImpl/src/ASTPrinter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'JSImpl') diff --git a/JSImpl/src/ASTPrinter.cpp b/JSImpl/src/ASTPrinter.cpp index 7b298da..2978f4c 100644 --- a/JSImpl/src/ASTPrinter.cpp +++ b/JSImpl/src/ASTPrinter.cpp @@ -136,6 +136,7 @@ public: void Print( const char* name, const IPLString& member, bool isLast); void Print( const char* name, bool member, bool isLast); void Print( const char* name, const TokenType& member, bool isLast); + void Print( const char* name, const double& member, bool isLast); inline void Enter(); inline void Exit(); @@ -263,6 +264,13 @@ void ASTToJsonPrinter::Print(const char* name, const IPLString& member, bool isL PrepNextElement(m_Output, isLast); } +void ASTToJsonPrinter::Print(const char* name, const double& member, bool isLast) +{ + InsertIndent(); + m_Output << "\"" << name << "\": " << member; + PrepNextElement(m_Output, isLast); +} + #define MEMBERS_COUNT(type, name, def) ++membersCount; -- cgit v1.3.1-23-gd82d