UNPKG

553 Btext/x-cView Raw
1#include "../ast.hpp"
2#include "../context.hpp"
3#include "../parser.hpp"
4#include <string>
5#include <iostream>
6
7using namespace Sass;
8
9Context ctx = Context::Data();
10
11Compound_Selector* selector(std::string src)
12{ return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_compound_selector(); }
13
14void diff(std::string s, std::string t)
15{
16 std::cout << s << " - " << t << " = " << selector(s + ";")->minus(selector(t + ";"), ctx)->to_string() << std::endl;
17}
18
19int main()
20{
21 diff(".a.b.c", ".c.b");
22 diff(".a.b.c", ".fludge.b");
23
24 return 0;
25}