aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorRJ Catalano <rcatalano@macsales.com>2016-02-10 05:43:23 +0800
committerRJ Catalano <rcatalano@macsales.com>2016-02-19 01:22:56 +0800
commitf4da1260184d5695287c30181734cff4d7e3d737 (patch)
tree65cf0d92f4c001931bcf37a7aa6a4fb5049a28ca /libsolidity/ast
parent7b918a7bc7a3c619682266b1c2566dacb9dcc765 (diff)
downloaddexon-solidity-f4da1260184d5695287c30181734cff4d7e3d737.tar.gz
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/ast')
-rw-r--r--libsolidity/ast/Types.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index df96d412..774be521 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -122,7 +122,7 @@ TypePointer Type::fromElementaryTypeName(ElementaryTypeNameToken const& _type)
"Expected an elementary type name but got " + tokenString);
Token::Value token = _type.returnTok();
- unsigned int M = _type.returnM();
+ unsigned int M = _type.firstNumber();
switch (token)
{
@@ -156,14 +156,10 @@ TypePointer Type::fromElementaryTypeName(ElementaryTypeNameToken const& _type)
TypePointer Type::fromElementaryTypeName(string const& _name)
{
- string keyword = _name.substr(0, _name.find_first_of("0123456789"));
- string info = "";
- if (_name.find_first_of("0123456789") != string::npos)
- {
- keyword += "M";
- info = _name.substr(_name.find_first_of("0123456789"));
- }
- return fromElementaryTypeName(ElementaryTypeNameToken(Token::fromIdentifierOrKeyword(keyword), info));
+ string details;
+ Token::Value token;
+ tie(token, details) = Token::fromIdentifierOrKeyword(_name);
+ return fromElementaryTypeName(ElementaryTypeNameToken(token, details));
}
TypePointer Type::forLiteral(Literal const& _literal)