aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Token.h
diff options
context:
space:
mode:
authorRJ Catalano <rcatalano@macsales.com>2016-03-08 02:29:41 +0800
committerchriseth <c@ethdev.com>2016-03-12 00:49:32 +0800
commit953e92b6f53ffee90cac3a79828a668cf1a55435 (patch)
treebbddc34aeec1e0afe3b32f406727ad8fe6824c05 /libsolidity/parsing/Token.h
parent29b74be413ea2661f2fa181bff89bef2371deb51 (diff)
downloaddexon-solidity-953e92b6f53ffee90cac3a79828a668cf1a55435.tar
dexon-solidity-953e92b6f53ffee90cac3a79828a668cf1a55435.tar.gz
dexon-solidity-953e92b6f53ffee90cac3a79828a668cf1a55435.tar.bz2
dexon-solidity-953e92b6f53ffee90cac3a79828a668cf1a55435.tar.lz
dexon-solidity-953e92b6f53ffee90cac3a79828a668cf1a55435.tar.xz
dexon-solidity-953e92b6f53ffee90cac3a79828a668cf1a55435.tar.zst
dexon-solidity-953e92b6f53ffee90cac3a79828a668cf1a55435.zip
added from identifier or keyword handling of fixed types
Diffstat (limited to 'libsolidity/parsing/Token.h')
-rw-r--r--libsolidity/parsing/Token.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h
index 59b5e520..c81e4210 100644
--- a/libsolidity/parsing/Token.h
+++ b/libsolidity/parsing/Token.h
@@ -305,10 +305,11 @@ public:
static std::tuple<Token::Value, unsigned short, unsigned short> fromIdentifierOrKeyword(std::string const& _literal);
private:
- // extractM provides a safe way to extract numbers,
- // if out_of_range error is thrown, they returns 0s, therefore securing
- // the variable's identity as an identifier.
- static unsigned extractM(std::string const& _literal);
+ // extractUnsigned provides a safe way to extract numbers,
+ // the variable's identity as an identifier. If an invalid conversion
+ // error is thrown (usually in the case of grabbing N from a fixed type)
+ // then a 1 is thrown to purposely ensure that it will declare itself as an identifier
+ static unsigned extractUnsigned(std::string const& _literal);
// @returns the keyword with name @a _name or Token::Identifier of no such keyword exists.
static Token::Value keywordByName(std::string const& _name);
static char const* const m_name[NUM_TOKENS];