-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cleanups in parser and parser tests. #473
Conversation
parsing code a little more readable.
🎉 Great news! Looks like all the dependencies have been resolved: 💡 To add or remove a dependency please update this issue/PR description. Brought to you by Dependent Issues (:robot: ). Happy coding! |
@@ -316,6 +316,26 @@ auto MatchNode(Args... args) -> ExpectedNode { | |||
return MatchNode(ParseNodeKind::kind(), args...); \ | |||
} | |||
#include "parse_node_kind.def" | |||
|
|||
// Helper for matching a designator `lhs.rhs`. | |||
auto MatchDesignator(ExpectedNode lhs, std::string rhs) -> ExpectedNode { |
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.
const& or llvm::StringRef?
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.
or maybe std::move in the body
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.
Added std::move
here and also in the other matchers. (I'd not been worrying too much about copies in this test-only code but I suppose we could end up doing a lot of vector
deep copies here.)
These contain `vector<ExpectedNode>`s, resulting in deep copies of potentially large trees.
Depends on #470.