2 #include "../context.hpp"
3 #include "../parser.hpp"
8 Context ctx = Context(Context::Data());
10 Compound_Selector* selector(std::string src)
11 { return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_compound_selector(); }
13 void unify(std::string lhs, std::string rhs)
15 Compound_Selector* unified = selector(lhs + ";")->unify_with(selector(rhs + ";"), ctx);
16 std::cout << lhs << " UNIFIED WITH " << rhs << " =\t" << (unified ? unified->to_string() : "NOTHING") << std::endl;
21 unify(".foo", ".foo.bar");
22 unify("div:nth-of-type(odd)", "div:first-child");
23 unify("div", "span:whatever");
25 unify("foo:bar::after", "foo:bar::first-letter");
26 unify(".foo#bar.hux", ".hux.foo#bar");
27 unify(".foo#bar.hux", ".hux.foo#baz");
28 unify("*:blah:fudge", "p:fudge:blah");