From e130bc7e7cc647b15c448133f725a060910da587 Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Thu, 14 Jan 2016 01:58:09 +0000 Subject: check whether break/continue is in the loop --- libsolidity/interface/CompilerStack.cpp | 6 ++++++ libsolidity/interface/Exceptions.cpp | 3 +++ libsolidity/interface/Exceptions.h | 1 + 3 files changed, 10 insertions(+) (limited to 'libsolidity/interface') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index a6f6f224..8a0d2f5e 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -122,6 +123,11 @@ bool CompilerStack::parse() resolveImports(); bool noErrors = true; + SyntaxChecker syntaxChecker(m_errors); + for (Source const* source: m_sourceOrder) + if (!syntaxChecker.checkSyntax(*source->ast)) + return false; + DocStringAnalyser docStringAnalyser(m_errors); for (Source const* source: m_sourceOrder) if (!docStringAnalyser.analyseDocStrings(*source->ast)) diff --git a/libsolidity/interface/Exceptions.cpp b/libsolidity/interface/Exceptions.cpp index 465c3d2f..6d72520b 100644 --- a/libsolidity/interface/Exceptions.cpp +++ b/libsolidity/interface/Exceptions.cpp @@ -39,6 +39,9 @@ Error::Error(Type _type): m_type(_type) case Type::ParserError: m_typeName = "Parser Error"; break; + case Type::SyntaxError: + m_typeName = "Syntax Error"; + break; case Type::TypeError: m_typeName = "Type Error"; break; diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h index 14be3c3d..07835320 100644 --- a/libsolidity/interface/Exceptions.h +++ b/libsolidity/interface/Exceptions.h @@ -47,6 +47,7 @@ public: DocstringParsingError, ParserError, TypeError, + SyntaxError, Why3TranslatorError, Warning }; -- cgit From c8886ed5cfc4f0b7bf4e8d52eb94da7137c9b70e Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Tue, 19 Jan 2016 02:16:13 +0000 Subject: code changes according to Chris's comments --- libsolidity/interface/CompilerStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/interface') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 8a0d2f5e..8ff63056 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -126,7 +126,7 @@ bool CompilerStack::parse() SyntaxChecker syntaxChecker(m_errors); for (Source const* source: m_sourceOrder) if (!syntaxChecker.checkSyntax(*source->ast)) - return false; + noErrors = false; DocStringAnalyser docStringAnalyser(m_errors); for (Source const* source: m_sourceOrder) -- cgit