Sha256: 41663132f3b91bde17c73b881e7a2614f76f86d6fc3f68d0955e0240d65af010

Contents?: true

Size: 613 Bytes

Versions: 25

Compression:

Stored size: 613 Bytes

Contents

#include "../ast.hpp"
#include "../context.hpp"
#include "../parser.hpp"
#include "../to_string.hpp"
#include <string>
#include <iostream>

using namespace std;
using namespace Sass;

Context ctx = Context::Data();
To_String to_string;

Compound_Selector* selector(string src)
{ return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_simple_selector_sequence(); }

void diff(string s, string t)
{
  cout << s << " - " << t << " = " << selector(s + ";")->minus(selector(t + ";"), ctx)->perform(&to_string) << endl;
}

int main()
{
  diff(".a.b.c", ".c.b");
  diff(".a.b.c", ".fludge.b");

  return 0;
}

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
sassc-0.0.6 ext/libsass/test/test_selector_difference.cpp
sassc-0.0.5 ext/libsass/test/test_selector_difference.cpp
sassc-0.0.4 ext/libsass/test/test_selector_difference.cpp
sassc-0.0.2 ext/libsass/test/test_selector_difference.cpp
sassc-0.0.1 ext/libsass/test/test_selector_difference.cpp