aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Token.h
diff options
context:
space:
mode:
authorVoR0220 <catalanor0220@gmail.com>2016-03-30 11:32:40 +0800
committerVoR0220 <catalanor0220@gmail.com>2016-03-31 00:54:00 +0800
commit6c61e28dc22894a8b035ba25ed727db664a4b163 (patch)
treea4dea06ac33b8eae2e6c8a6fc9ffdc7be6aec3b8 /libsolidity/parsing/Token.h
parent63951683717004449eb85dd41157ee586953b55d (diff)
downloaddexon-solidity-6c61e28dc22894a8b035ba25ed727db664a4b163.tar.gz
dexon-solidity-6c61e28dc22894a8b035ba25ed727db664a4b163.tar.zst
dexon-solidity-6c61e28dc22894a8b035ba25ed727db664a4b163.zip
Got it working exactly like you wanted ;)
Diffstat (limited to 'libsolidity/parsing/Token.h')
-rw-r--r--libsolidity/parsing/Token.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h
index 31646f8d..e7a7e24c 100644
--- a/libsolidity/parsing/Token.h
+++ b/libsolidity/parsing/Token.h
@@ -190,18 +190,18 @@ namespace solidity
K(After, "after", 0) \
/* type keywords*/ \
K(Int, "int", 0) \
- T(IntM, "intM", 0) \
K(UInt, "uint", 0) \
- T(UIntM, "uintM", 0) \
K(Bytes, "bytes", 0) \
- T(BytesM, "bytesM", 0) \
K(Byte, "byte", 0) \
K(String, "string", 0) \
K(Address, "address", 0) \
K(Bool, "bool", 0) \
K(Fixed, "fixed", 0) \
- T(FixedMxN, "fixedMxN", 0) \
K(UFixed, "ufixed", 0) \
+ T(IntM, "intM", 0) \
+ T(UIntM, "uintM", 0) \
+ T(BytesM, "bytesM", 0) \
+ T(FixedMxN, "fixedMxN", 0) \
T(UFixedMxN, "ufixedMxN", 0) \
T(TypesEnd, NULL, 0) /* used as type enum end marker */ \
\
@@ -334,8 +334,10 @@ public:
std::string name = Token::toString(m_token);
if (tokenValue || (firstNumber() == 0 && secondNumber() == 0))
return name;
- //need to set it up this way for fixed types construction in future
- return name.substr(0, name.size() - 1) + std::to_string(m_firstNumber);
+ else if (m_token == Token::FixedMxN || m_token == Token::UFixedMxN)
+ return name.substr(0, name.size() - 3) + std::to_string(m_firstNumber) + "x" + std::to_string(m_secondNumber);
+ else
+ return name.substr(0, name.size() - 1) + std::to_string(m_firstNumber);
}
private: