UNPKG

535 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
11Selector* selector(std::string src)
12{ return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_selector_list(); }
13
14void spec(std::string sel)
15{ std::cout << sel << "\t::\t" << selector(sel + ";")->specificity() << std::endl; }
16
17int main()
18{
19 spec("foo bar hux");
20 spec(".foo .bar hux");
21 spec("#foo .bar[hux='mux']");
22 spec("a b c d e f");
23
24 return 0;
25}