diff options
author | LianaHus <liana@ethdev.com> | 2015-10-15 02:37:41 +0800 |
---|---|---|
committer | LianaHus <liana@ethdev.com> | 2015-10-15 02:37:41 +0800 |
commit | c3491e446964f366101f28e3d51ab59dd9aaa5b2 (patch) | |
tree | 75a261126d7c0eb7919db32603aea44e5fe443ba /libsolidity/Parser.h | |
parent | 8f7f22c5a6b1a71d7baff489b6425670550e8e8b (diff) | |
download | dexon-solidity-c3491e446964f366101f28e3d51ab59dd9aaa5b2.tar.gz dexon-solidity-c3491e446964f366101f28e3d51ab59dd9aaa5b2.tar.zst dexon-solidity-c3491e446964f366101f28e3d51ab59dd9aaa5b2.zip |
errors instead of exceptions
Conflicts:
libsolidity/CompilerStack.cpp
libsolidity/NameAndTypeResolver.cpp
libsolidity/NameAndTypeResolver.h
libsolidity/TypeChecker.cpp
test/libsolidity/SolidityNameAndTypeResolution.cpp
Diffstat (limited to 'libsolidity/Parser.h')
-rw-r--r-- | libsolidity/Parser.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libsolidity/Parser.h b/libsolidity/Parser.h index c9acb47d..3fc3768e 100644 --- a/libsolidity/Parser.h +++ b/libsolidity/Parser.h @@ -34,7 +34,8 @@ class Scanner; class Parser { public: - Parser() {} + Parser(ErrorList& errors): + m_errors(errors){}; ASTPointer<SourceUnit> parse(std::shared_ptr<Scanner> const& _scanner); std::shared_ptr<std::string const> const& sourceName() const; @@ -145,13 +146,19 @@ private: /// Creates an empty ParameterList at the current location (used if parameters can be omitted). ASTPointer<ParameterList> createEmptyParameterList(); - /// Creates a @ref ParserError exception and annotates it with the current position and the + /// Creates a @ref ParserError and annotates it with the current position and the /// given @a _description. - Error createParserError(std::string const& _description) const; + void parserError(std::string const& _description); + + /// Creates a @ref ParserError and annotates it with the current position and the + /// given @a _description. Throws the FatalError. + void fatalParserError(std::string const& _description); std::shared_ptr<Scanner> m_scanner; /// Flag that signifies whether '_' is parsed as a PlaceholderStatement or a regular identifier. bool m_insideModifier = false; + /// The reference to the list of errors and warning to add errors/warnings during parsing + ErrorList& m_errors; }; } |