diff options
5 files changed, 32 insertions, 30 deletions
| -rw-r--r-- | JSImpl/src/ASTInterpreter.cpp | 1 | ||||
| -rw-r--r-- | JSImpl/src/Expression.h | 7 | ||||
| -rw-r--r-- | JSImpl/src/JSONParser.cpp | 2 | ||||
| -rw-r--r-- | JSImpl/src/Lexer.cpp | 5 | ||||
| -rw-r--r-- | JSImpl/src/Parser.cpp | 47 |
diff --git a/JSImpl/src/ASTInterpreter.cpp b/JSImpl/src/ASTInterpreter.cpp index f56706a..baf38ae 100644 --- a/JSImpl/src/ASTInterpreter.cpp +++ b/JSImpl/src/ASTInterpreter.cpp @@ -229,6 +229,7 @@ struct LValueExtractor : public ExpressionVisitor public: LValueExtractor(ASTInterpreter* interpreter) : m_Interpreter(interpreter) + , m_LValue(nullptr) {} ~LValueExtractor() {} diff --git a/JSImpl/src/Expression.h b/JSImpl/src/Expression.h index 333568f..570687a 100644 --- a/JSImpl/src/Expression.h +++ b/JSImpl/src/Expression.h @@ -38,14 +38,17 @@ class Expression : public IPLEnableShared<Expression> public: \ ClassName(MEMBERS_ITERATOR(EXPAND_ARGUMENT) bool __dummy = 0) \ : \ - MEMBERS_ITERATOR(EXPAND_INITIALIZER_LIST) m_dummy(__dummy) {} \ + MEMBERS_ITERATOR(EXPAND_INITIALIZER_LIST) m_dummy(__dummy) \ + { \ + (void)m_dummy; /* silence warning about unused private field */ \ + } \ virtual ~ClassName() {} \ virtual void Accept(ExpressionVisitor& v) override { v.Visit(this); } \ \ MEMBERS_ITERATOR(GENERATE_GETTERS) \ private: \ MEMBERS_ITERATOR(GENERATE_MEMBER_DEFINITIONS) \ - bool m_dummy; \ + bool m_dummy; /* NOLINT */ \ }; EXPRESSION_DEFINITION_ITERATOR(GENERATE_EXPRESSION); diff --git a/JSImpl/src/JSONParser.cpp b/JSImpl/src/JSONParser.cpp index 275fb0e..3f87aad 100644 --- a/JSImpl/src/JSONParser.cpp +++ b/JSImpl/src/JSONParser.cpp @@ -55,7 +55,7 @@ EXPRESSION_DEFINITION_ITERATOR(GENERATE_EXPRESSION_TYPE_ENUMS); #undef GENERATE_EXPRESSION_TYPE_ENUM_MEMBERS template <typename T> -ExpressionPtr JSONParseWrap(const char*& json, const char* eName) +ExpressionPtr JSONParseWrap(const char*&, const char*) { assert(false); return nullptr; diff --git a/JSImpl/src/Lexer.cpp b/JSImpl/src/Lexer.cpp index 4a2deb8..30a7e42 100644 --- a/JSImpl/src/Lexer.cpp +++ b/JSImpl/src/Lexer.cpp @@ -33,11 +33,6 @@ inline bool IsStringBound(char c) return c == '\'' || c == '"'; } -inline bool IsWhiteSpace(char c) -{ - return c == ' '; -} - inline bool IsNewLine(char c) { return c == '\n'; diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp index 4bc97ce..8f415fb 100644 --- a/JSImpl/src/Parser.cpp +++ b/JSImpl/src/Parser.cpp @@ -140,7 +140,8 @@ ExpressionPtr Parser::PrimaryExpression(NormalType a) { if (a == NormalType::Initial) { - return SimpleExpression(); + auto simple = SimpleExpression(); + return simple; } if (auto simple = SimpleExpression()) @@ -373,12 +374,12 @@ ExpressionPtr Parser::LeftSideExpression(NormalType a) { ExpressionPtr result; auto ss = Snapshot(); - if (result = CallExpression(a)) + if ((result = CallExpression(a))) { return result; } Restore(ss); - if (result = ShortNewExpression()) + if ((result = ShortNewExpression())) { return result; } @@ -464,12 +465,12 @@ ExpressionPtr Parser::ShortNewSubexpression() { ExpressionPtr result; auto ss = Snapshot(); - if (result = FullNewSubexpression()) + if ((result = FullNewSubexpression())) { return result; } Restore(ss); - if (result = ShortNewExpression()) + if ((result = ShortNewExpression())) { return result; } @@ -490,7 +491,7 @@ ExpressionPtr Parser::FullNewExpression() ExpressionPtr Parser::FullNewSubexpression() { ExpressionPtr result; - if (result = PrimaryExpression(NormalType::Normal)) + if ((result = PrimaryExpression(NormalType::Normal))) { return result; } @@ -682,9 +683,11 @@ ExpressionPtr Parser::ConditionalExpression(NormalType a, AllowType b) if (Match(TokenType::QuestionMark)) { auto trueExpr= AssignmentExpression(NormalType::Normal, b); + (void)trueExpr; if (Match(TokenType::Colon)) { auto falseExpr = AssignmentExpression(NormalType::Normal, b); + (void)falseExpr; // TODO implement trinary operator assert(false); return ExpressionPtr(); @@ -764,22 +767,22 @@ ExpressionPtr Parser::Expression(NormalType a, AllowType b) ExpressionPtr Parser::Statement() { ExpressionPtr result; - if (result = EmptyStatement()) return result; - if (result = Expression(NormalType::Initial, AllowType::AllowIn)) return result; - if (result = VariableDefinition(AllowType::AllowIn)) return result; - if (result = Block()) return result; - if (result = LabeledStatement()) return result; - if (result = IfStatementfull()) return result; - if (result = SwitchStatement()) return result; - if (result = DoStatement()) return result; - if (result = WhileStatement()) return result; - if (result = ForStatement()) return result; - if (result = WithStatement()) return result; - if (result = ContinueStatement()) return result; - if (result = BreakStatement()) return result; - if (result = OptionalLabel()) return result; - if (result = ReturnStatement()) return result; - if (result = TryStatement()) return result; + if ((result = EmptyStatement())) return result; + if ((result = Expression(NormalType::Initial, AllowType::AllowIn))) return result; + if ((result = VariableDefinition(AllowType::AllowIn))) return result; + if ((result = Block())) return result; + if ((result = LabeledStatement())) return result; + if ((result = IfStatementfull())) return result; + if ((result = SwitchStatement())) return result; + if ((result = DoStatement())) return result; + if ((result = WhileStatement())) return result; + if ((result = ForStatement())) return result; + if ((result = WithStatement())) return result; + if ((result = ContinueStatement())) return result; + if ((result = BreakStatement())) return result; + if ((result = OptionalLabel())) return result; + if ((result = ReturnStatement())) return result; + if ((result = TryStatement())) return result; return result; } |
