Breaking: fixed keywords added in for token type#416
Breaking: fixed keywords added in for token type#416VoR0220 wants to merge 10 commits intoargotorg:developfrom
Conversation
|
Is that all we need? Don't we need additional checks in |
|
Ah, you wanted those in there too. I figured you only wanted the keywords and we could handle the fromIdentifier package when we actually implement fixed. But I suppose we can do that here too. |
|
just realized...if an invalid argument gets thrown in extractUnsigned for a bytes type, it might actually be able to make it through. Going to change this to a zero. |
libsolidity/parsing/Token.h
Outdated
| // 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 0 is thrown to purposely ensure that it will declare itself as an identifier | ||
| static unsigned extractUnsigned(std::string const& _literal); |
There was a problem hiding this comment.
Can we change that to take two const iterators (_begin and _end) instead of a string? In that case we do not have to copy the string.
There was a problem hiding this comment.
Yeah, we can do that. Good idea.
There was a problem hiding this comment.
done and on the way.
libsolidity/parsing/Token.cpp
Outdated
| TOKEN_LIST(KT, KK) | ||
| }; | ||
| unsigned Token::extractM(string const& _literal) | ||
| unsigned Token::extractUnsigned(string::const_iterator const& _begin, string::const_iterator const& _end) |
There was a problem hiding this comment.
Iterators should be passed by value
There was a problem hiding this comment.
I've been trying to figure out how to make this work with iterators but nothing is clicking so far.
- some style fixes
inline and assembly keywords added
libsolidity/parsing/Token.cpp
Outdated
| return m; | ||
| } | ||
| catch(out_of_range& e) | ||
| catch(const boost::bad_lexical_cast &) |
There was a problem hiding this comment.
boost::bad_lexical_cast const&
|
Please also add |
|
either we need to pick a different name for timestamp or we need to redo something in the compiler because currently it's causing a conflict with |
|
Subsumed by #429 |
Note: Do not merge until 0.3.0.