-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking: fixed keywords added in for token type #416
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. |
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can do that. Good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done and on the way.
@@ -101,17 +108,21 @@ char const Token::m_tokenType[] = | |||
{ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iterators should be passed by value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
return m; | ||
} | ||
catch(out_of_range& e) | ||
catch(const boost::bad_lexical_cast &) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.