Created
March 17, 2014 23:01
-
-
Save redbaron/9610165 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/spirit/home/x3.hpp> | |
#include <string> | |
int main() { | |
namespace x3 = boost::spirit::x3; | |
const std::string input = "A\nB\nC"; | |
auto const p = *(x3::char_ >> x3::omit[x3::lit("\n")]); | |
std::string attr; | |
auto it = input.begin(); | |
x3::parse(it, input.end(), p, attr); | |
assert(attr == "AB"); //it is ABC without patch | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment