From 8aa55f1c0d34f0938dc3abc29f5cd1bfd705b487 Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Sun, 14 Oct 2018 17:49:08 +0300 Subject: Minor fixes. --- JSImpl/src/ASTPrinter.cpp | 5 +++-- JSImpl/src/Parser.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'JSImpl/src') diff --git a/JSImpl/src/ASTPrinter.cpp b/JSImpl/src/ASTPrinter.cpp index d8f5ff8..4dc07f4 100644 --- a/JSImpl/src/ASTPrinter.cpp +++ b/JSImpl/src/ASTPrinter.cpp @@ -36,12 +36,13 @@ void Print(std::ostream& os, ASTPrinter &printer, const char* name, const IPLVec void Print(std::ostream& os, ASTPrinter &printer, const char* name, const IPLVector& list, bool isLast) { - os << "\"" << name << "\" : [ \n"; + os << "\"" << name << "\" : ["; for (auto i = 0; i < list.size(); ++i) { + os << "\"" << list[i] << "\""; if (i + 1 != list.size()) { - os << list[i] << ","; + os << ","; } } os << "]"; diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp index 28fee72..9bf9922 100644 --- a/JSImpl/src/Parser.cpp +++ b/JSImpl/src/Parser.cpp @@ -930,7 +930,7 @@ ExpressionPtr Parser::Parse() ExpressionPtr Parser::FunctionDefinition() { - auto FormalParameters = [=](IPLVector identifiers) -> bool { + auto FormalParameters = [=](IPLVector& identifiers) -> bool { if (Match(TokenType::LeftParen)) { while (Match(TokenType::Identifier)) -- cgit v1.3.1-23-gd82d