From b424446c5fc437adc7b128d7e59bfac309bae3bb Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 17 Apr 2019 07:02:30 -0400 Subject: [PATCH] Move SemVerHandler to analysis to parsing to increase modularity... If ever you want to separate building analysis from scanning/parsing/ast, this will help. --- liblangutil/CMakeLists.txt | 2 ++ {libsolidity/analysis => liblangutil}/SemVerHandler.cpp | 4 ++-- {libsolidity/analysis => liblangutil}/SemVerHandler.h | 7 ++----- libsolidity/CMakeLists.txt | 2 -- libsolidity/analysis/PostTypeChecker.cpp | 2 +- libsolidity/analysis/SyntaxChecker.cpp | 2 +- libsolidity/interface/CompilerStack.cpp | 2 +- libsolidity/parsing/Parser.cpp | 2 +- test/libsolidity/SemVerMatcher.cpp | 2 +- 9 files changed, 11 insertions(+), 14 deletions(-) rename {libsolidity/analysis => liblangutil}/SemVerHandler.cpp (98%) rename {libsolidity/analysis => liblangutil}/SemVerHandler.h (97%) diff --git a/liblangutil/CMakeLists.txt b/liblangutil/CMakeLists.txt index 1c3d5a05e..4cac9d8bb 100644 --- a/liblangutil/CMakeLists.txt +++ b/liblangutil/CMakeLists.txt @@ -12,6 +12,8 @@ set(sources ParserBase.h Scanner.cpp Scanner.h + SemVerHandler.cpp + SemVerHandler.h SourceLocation.h SourceReferenceExtractor.cpp SourceReferenceExtractor.h diff --git a/libsolidity/analysis/SemVerHandler.cpp b/liblangutil/SemVerHandler.cpp similarity index 98% rename from libsolidity/analysis/SemVerHandler.cpp rename to liblangutil/SemVerHandler.cpp index 7c6ba91fc..378923420 100644 --- a/libsolidity/analysis/SemVerHandler.cpp +++ b/liblangutil/SemVerHandler.cpp @@ -20,13 +20,13 @@ * Utilities to handle semantic versioning. */ -#include +#include #include using namespace std; using namespace dev; -using namespace dev::solidity; +using namespace langutil; SemVerVersion::SemVerVersion(string const& _versionString) { diff --git a/libsolidity/analysis/SemVerHandler.h b/liblangutil/SemVerHandler.h similarity index 97% rename from libsolidity/analysis/SemVerHandler.h rename to liblangutil/SemVerHandler.h index 801856121..09e6c6f4a 100644 --- a/libsolidity/analysis/SemVerHandler.h +++ b/liblangutil/SemVerHandler.h @@ -22,13 +22,11 @@ #pragma once -#include +#include #include #include -namespace dev -{ -namespace solidity +namespace langutil { class SemVerError: dev::Exception @@ -109,4 +107,3 @@ private: }; } -} diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt index a768080e8..637c18415 100644 --- a/libsolidity/CMakeLists.txt +++ b/libsolidity/CMakeLists.txt @@ -22,8 +22,6 @@ set(sources analysis/PostTypeChecker.h analysis/ReferencesResolver.cpp analysis/ReferencesResolver.h - analysis/SemVerHandler.cpp - analysis/SemVerHandler.h analysis/StaticAnalyzer.cpp analysis/StaticAnalyzer.h analysis/SyntaxChecker.cpp diff --git a/libsolidity/analysis/PostTypeChecker.cpp b/libsolidity/analysis/PostTypeChecker.cpp index 6a7e5c7eb..936e133ca 100644 --- a/libsolidity/analysis/PostTypeChecker.cpp +++ b/libsolidity/analysis/PostTypeChecker.cpp @@ -17,10 +17,10 @@ #include -#include #include #include #include +#include #include #include diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index 7b8aa0f27..5f108c6f9 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -17,12 +17,12 @@ #include -#include #include #include #include #include +#include #include #include diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 3dfcc9267..a4a3f1200 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +50,7 @@ #include #include +#include #include diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index d2e993cd7..cb4525b92 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -22,12 +22,12 @@ #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/test/libsolidity/SemVerMatcher.cpp b/test/libsolidity/SemVerMatcher.cpp index 2980acd1b..4a6c123ef 100644 --- a/test/libsolidity/SemVerMatcher.cpp +++ b/test/libsolidity/SemVerMatcher.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include using namespace std;