diff options
author | RJ Catalano <rcatalano@macsales.com> | 2016-02-10 05:43:23 +0800 |
---|---|---|
committer | RJ Catalano <rcatalano@macsales.com> | 2016-02-19 01:22:56 +0800 |
commit | f4da1260184d5695287c30181734cff4d7e3d737 (patch) | |
tree | 65cf0d92f4c001931bcf37a7aa6a4fb5049a28ca /libsolidity/parsing/Token.h | |
parent | 7b918a7bc7a3c619682266b1c2566dacb9dcc765 (diff) | |
download | dexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.tar dexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.tar.gz dexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.tar.bz2 dexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.tar.lz dexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.tar.xz dexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.tar.zst dexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.zip |
tests added and changes made
fixed some silly problems in Token.cpp
windows error fix
Diffstat (limited to 'libsolidity/parsing/Token.h')
-rw-r--r-- | libsolidity/parsing/Token.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 5f8141ae..55b801db 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -302,7 +302,7 @@ public: return m_precedence[tok]; } - static Token::Value fromIdentifierOrKeyword(std::string const& _name); + static std::tuple<Token::Value, std::string> fromIdentifierOrKeyword(std::string const& _name); private: static char const* const m_name[NUM_TOKENS]; @@ -314,25 +314,25 @@ private: class ElementaryTypeNameToken { public: - ElementaryTypeNameToken(Token::Value token, std::string const& description) + ElementaryTypeNameToken(Token::Value _token, std::string const& _detail) { - solAssert(isElementaryTypeName(token, description), ""); - std::tie(m_name, M, N) = setTypes(token, description); - tok = token; + std::tie(m_name, m_firstNumber, m_secondNumber) = parseDetails(_token, _detail); + m_token = _token; } - - std::string toString(bool const& tokValue = false) const& { return tokValue ? Token::toString(tok) : m_name; } - unsigned int const& returnM() const& { return M; } - unsigned int const& returnN() const& { return N; } - Token::Value const& returnTok() const& { return tok; } - static bool isElementaryTypeName(Token::Value _baseType, std::string const& _info); + + unsigned int const& firstNumber() const { return m_firstNumber; } + unsigned int const& secondNumber() const { return m_secondNumber; } + Token::Value const& returnTok() const { return m_token; } + ///if tokValue is set to true, then returns the actual token type name, otherwise, returns full type + std::string toString(bool const& tokValue = false) const { return tokValue ? Token::toString(m_token) : m_name; } private: - Token::Value tok; + Token::Value m_token; std::string m_name; - unsigned int M; - unsigned int N; - std::tuple<std::string, unsigned int, unsigned int> setTypes(Token::Value _baseType, std::string const& _toSet); + unsigned int m_firstNumber; + unsigned int m_secondNumber; + /// throws if _details is malformed + std::tuple<std::string, unsigned int, unsigned int> parseDetails(Token::Value _baseType, std::string const& _details); }; } |