CSS-Sass

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

t/sass-spec/spec/libsass-todo-tests/libsass/interpolated-urls/expected.compact.css
t/sass-spec/spec/libsass-todo-tests/libsass/interpolated-urls/expected.compressed.css
t/sass-spec/spec/libsass-todo-tests/libsass/interpolated-urls/expected.expanded.css
t/sass-spec/spec/libsass-todo-tests/libsass/interpolated-urls/expected_output.css
t/sass-spec/spec/libsass-todo-tests/libsass/interpolated-urls/input.scss
t/sass-spec/spec/libsass-todo-tests/libsass/lists/expected.compact.css
t/sass-spec/spec/libsass-todo-tests/libsass/lists/expected.compressed.css
t/sass-spec/spec/libsass-todo-tests/libsass/lists/expected.expanded.css
t/sass-spec/spec/libsass-todo-tests/libsass/lists/expected_output.css
t/sass-spec/spec/libsass-todo-tests/libsass/lists/input.scss
t/sass-spec/spec/libsass-todo-tests/libsass/propsets/expected.compact.css
t/sass-spec/spec/libsass-todo-tests/libsass/propsets/expected.compressed.css
t/sass-spec/spec/libsass-todo-tests/libsass/propsets/expected.expanded.css
t/sass-spec/spec/libsass-todo-tests/libsass/propsets/expected_output.css
t/sass-spec/spec/libsass-todo-tests/libsass/propsets/input.scss
t/sass-spec/spec/libsass-todo-tests/libsass/rel/expected.compact.css
t/sass-spec/spec/libsass-todo-tests/libsass/rel/expected.compressed.css
t/sass-spec/spec/libsass-todo-tests/libsass/rel/expected.expanded.css
t/sass-spec/spec/libsass-todo-tests/libsass/rel/expected_output.css
t/sass-spec/spec/libsass-todo-tests/libsass/rel/input.scss
t/sass-spec/spec/libsass-todo-tests/libsass/test/expected.compact.css
t/sass-spec/spec/libsass-todo-tests/libsass/test/expected.compressed.css
t/sass-spec/spec/libsass-todo-tests/libsass/test/expected.expanded.css
t/sass-spec/spec/libsass-todo-tests/libsass/test/expected_output.css
t/sass-spec/spec/libsass-todo-tests/libsass/test/input.scss

MANIFEST  view on Meta::CPAN

t/sass-spec/spec/scss/default-parameters/expected.compact.css
t/sass-spec/spec/scss/default-parameters/expected.compressed.css
t/sass-spec/spec/scss/default-parameters/expected.expanded.css
t/sass-spec/spec/scss/default-parameters/expected_output.css
t/sass-spec/spec/scss/default-parameters/input.scss
t/sass-spec/spec/scss/default-vars-in-default-params/expected.compact.css
t/sass-spec/spec/scss/default-vars-in-default-params/expected.compressed.css
t/sass-spec/spec/scss/default-vars-in-default-params/expected.expanded.css
t/sass-spec/spec/scss/default-vars-in-default-params/expected_output.css
t/sass-spec/spec/scss/default-vars-in-default-params/input.scss
t/sass-spec/spec/scss/directives-in-propsets/expected.compact.css
t/sass-spec/spec/scss/directives-in-propsets/expected.compressed.css
t/sass-spec/spec/scss/directives-in-propsets/expected.expanded.css
t/sass-spec/spec/scss/directives-in-propsets/expected_output.css
t/sass-spec/spec/scss/directives-in-propsets/input.scss
t/sass-spec/spec/scss/each/expected.compact.css
t/sass-spec/spec/scss/each/expected.compressed.css
t/sass-spec/spec/scss/each/expected.expanded.css
t/sass-spec/spec/scss/each/expected_output.css
t/sass-spec/spec/scss/each/input.scss
t/sass-spec/spec/scss/each_directive/expected.compact.css
t/sass-spec/spec/scss/each_directive/expected.compressed.css
t/sass-spec/spec/scss/each_directive/expected.expanded.css
t/sass-spec/spec/scss/each_directive/expected_output.css
t/sass-spec/spec/scss/each_directive/input.scss

MANIFEST  view on Meta::CPAN

t/sass-spec/spec/scss/ie-hex-str/expected.compact.css
t/sass-spec/spec/scss/ie-hex-str/expected.compressed.css
t/sass-spec/spec/scss/ie-hex-str/expected.expanded.css
t/sass-spec/spec/scss/ie-hex-str/expected_output.css
t/sass-spec/spec/scss/ie-hex-str/input.scss
t/sass-spec/spec/scss/if-in-mixin/expected.compact.css
t/sass-spec/spec/scss/if-in-mixin/expected.compressed.css
t/sass-spec/spec/scss/if-in-mixin/expected.expanded.css
t/sass-spec/spec/scss/if-in-mixin/expected_output.css
t/sass-spec/spec/scss/if-in-mixin/input.scss
t/sass-spec/spec/scss/if-in-propset/expected.compact.css
t/sass-spec/spec/scss/if-in-propset/expected.compressed.css
t/sass-spec/spec/scss/if-in-propset/expected.expanded.css
t/sass-spec/spec/scss/if-in-propset/expected_output.css
t/sass-spec/spec/scss/if-in-propset/input.scss
t/sass-spec/spec/scss/if/expected.compact.css
t/sass-spec/spec/scss/if/expected.compressed.css
t/sass-spec/spec/scss/if/expected.expanded.css
t/sass-spec/spec/scss/if/expected_output.css
t/sass-spec/spec/scss/if/input.scss
t/sass-spec/spec/scss/if_directive/expected.compact.css
t/sass-spec/spec/scss/if_directive/expected.compressed.css
t/sass-spec/spec/scss/if_directive/expected.expanded.css
t/sass-spec/spec/scss/if_directive/expected_output.css
t/sass-spec/spec/scss/if_directive/input.scss

libsass/ast.hpp  view on Meta::CPAN

    { statement_type(RULESET); }
    bool is_invisible();
    // nested rulesets need to be hoisted out of their enclosing blocks
    bool is_hoistable() { return true; }
    ATTACH_OPERATIONS();
  };

  /////////////////////////////////////////////////////////
  // Nested declaration sets (i.e., namespaced properties).
  /////////////////////////////////////////////////////////
  class Propset : public Has_Block {
    ADD_PROPERTY(String*, property_fragment);
  public:
    Propset(ParserState pstate, String* pf, Block* b = 0)
    : Has_Block(pstate, b), property_fragment_(pf)
    { }
    ATTACH_OPERATIONS();
  };

  /////////////////
  // Bubble.
  /////////////////
  class Bubble : public Statement {
    ADD_PROPERTY(Statement*, node);

libsass/ast_factory.hpp  view on Meta::CPAN


namespace Sass {
  using namespace std;

  class AST_Factory {
    vector<AST_Node*> nodes;
  public:
    // statements
    Block* new_Block(string p, size_t l, size_t s = 0, bool r = false);
    Ruleset* new_Ruleset(string p, size_t l, Selector* s, Block* b);
    Propset* new_Propset(string p, size_t l, String* pf, Block* b);
    Feature_Query* new_Feature_Query(string p, size_t l, Feature_Query* f, Block* b);
    Media_Query* new_Media_Query(string p, size_t l, List* q, Block* b);
    At_Root_Block* new_At_Root_Block(string p, size_t l, Selector* sel, Block* b);
    At_Rule* new_At_Rule(string p, size_t l, string kwd, Selector* sel, Block* b);
    Keyframe_Rule* new_Keyframe_Rule(string p, size_t l, Block* b);
    Declaration* new_Declaration(string p, size_t l, String* prop, List* vals);
    Assignment* new_Assignment(string p, size_t l, string var, Expression* val, bool guarded = false);
    Import<Function_Call*>* new_CSS_Import(string p, size_t l, Function_Call* loc);
    Import<String*>* new_SASS_Import(string p, size_t l, String* loc);
    Warning* new_Warning(string p, size_t l, Expression* msg);

libsass/ast_fwd_decl.hpp  view on Meta::CPAN

/////////////////////////////////////////////
namespace Sass {

  enum Output_Style { NESTED, EXPANDED, COMPACT, COMPRESSED, FORMATTED };

  class AST_Node;
  // statements
  class Statement;
  class Block;
  class Ruleset;
  class Propset;
  class Bubble;
  class Media_Block;
  class Feature_Block;
  class At_Rule;
  class Keyframe_Rule;
  class At_Root_Block;
  class Declaration;
  class Assignment;
  class Import;
  class Import_Stub;

libsass/cssize.hpp  view on Meta::CPAN

    Statement* fallback_impl(AST_Node* n);

  public:
    Cssize(Context&, Env*, Backtrace*);
    virtual ~Cssize() { }

    using Operation<Statement*>::operator();

    Statement* operator()(Block*);
    Statement* operator()(Ruleset*);
    // Statement* operator()(Propset*);
    // Statement* operator()(Bubble*);
    Statement* operator()(Media_Block*);
    Statement* operator()(Feature_Block*);
    Statement* operator()(At_Root_Block*);
    Statement* operator()(At_Rule*);
    Statement* operator()(Keyframe_Rule*);
    // Statement* operator()(Declaration*);
    // Statement* operator()(Assignment*);
    // Statement* operator()(Import*);
    // Statement* operator()(Import_Stub*);

libsass/debugger.hpp  view on Meta::CPAN

    cerr << " (" << pstate_source_position(node) << ")";
    cerr << " [block:" << selector->last_block() << "]";
    cerr << " [weight:" << longToHex(selector->specificity()) << "]";
    // cerr << (selector->last_block() && selector->last_block()->is_root() ? " [root]" : "");
    cerr << " [@media:" << selector->media_block() << "]";
    cerr << (selector->is_optional() ? " [is_optional]": " -");
    cerr << (selector->has_line_break() ? " [line-break]": " -");
    cerr << (selector->has_line_feed() ? " [line-feed]": " -");
    cerr << " <" << prettyprint(selector->pstate().token.ws_before()) << ">" << endl;
    for(auto i : selector->elements()) { debug_ast(i, ind + " ", env); }
  } else if (dynamic_cast<Propset*>(node)) {
    Propset* selector = dynamic_cast<Propset*>(node);
    cerr << ind << "Propset " << selector;
    cerr << " (" << pstate_source_position(node) << ")";
    cerr << " " << selector->tabs() << endl;
    if (selector->block()) for(auto i : selector->block()->elements()) { debug_ast(i, ind + " ", env); }
  } else if (dynamic_cast<Wrapped_Selector*>(node)) {
    Wrapped_Selector* selector = dynamic_cast<Wrapped_Selector*>(node);
    cerr << ind << "Wrapped_Selector " << selector;
    cerr << " (" << pstate_source_position(node) << ")";
    cerr << " <<" << selector->name() << ">>" << (selector->has_line_break() ? " [line-break]": " -") << (selector->has_line_feed() ? " [line-feed]": " -") << endl;
    debug_ast(selector->selector(), ind + " () ", env);
  } else if (dynamic_cast<Pseudo_Selector*>(node)) {

libsass/expand.cpp  view on Meta::CPAN

    Ruleset* rr = new (ctx.mem) Ruleset(r->pstate(),
                                        sel_ctx,
                                        blk);
    rr->tabs(r->tabs());
    selector_stack.pop_back();
    in_at_root = old_in_at_root;
    old_in_at_root = false;
    return rr;
  }

  Statement* Expand::operator()(Propset* p)
  {
    property_stack.push_back(p->property_fragment());
    Block* expanded_block = p->block()->perform(this)->block();

    Block* current_block = block_stack.back();
    for (size_t i = 0, L = expanded_block->length(); i < L; ++i) {
      Statement* stm = (*expanded_block)[i];
      if (typeid(*stm) == typeid(Declaration)) {
        Declaration* dec = static_cast<Declaration*>(stm);
        String_Schema* combined_prop = new (ctx.mem) String_Schema(p->pstate());

libsass/expand.cpp  view on Meta::CPAN

                         << new (ctx.mem) String_Constant(p->pstate(), "-")
                         << dec->property(); // TODO: eval the prop into a string constant
        }
        else {
          *combined_prop << dec->property();
        }
        dec->property(combined_prop);
        *current_block << dec;
      }
      else if (typeid(*stm) == typeid(Comment)) {
        // drop comments in propsets
      }
      else {
        error("contents of namespaced properties must result in style declarations only", stm->pstate(), backtrace);
      }
    }

    property_stack.pop_back();

    return 0;
  }

libsass/expand.hpp  view on Meta::CPAN

    Statement* fallback_impl(AST_Node* n);

  public:
    Expand(Context&, Eval*, Contextualize_Eval*, Env*, Backtrace*);
    virtual ~Expand() { }

    using Operation<Statement*>::operator();

    Statement* operator()(Block*);
    Statement* operator()(Ruleset*);
    Statement* operator()(Propset*);
    Statement* operator()(Media_Block*);
    Statement* operator()(Feature_Block*);
    Statement* operator()(At_Root_Block*);
    Statement* operator()(At_Rule*);
    Statement* operator()(Declaration*);
    Statement* operator()(Assignment*);
    Statement* operator()(Import*);
    Statement* operator()(Import_Stub*);
    Statement* operator()(Warning*);
    Statement* operator()(Error*);

libsass/inspect.cpp  view on Meta::CPAN

    ruleset->selector()->perform(this);
    ruleset->block()->perform(this);
  }

  void Inspect::operator()(Keyframe_Rule* rule)
  {
    if (rule->selector()) rule->selector()->perform(this);
    if (rule->block()) rule->block()->perform(this);
  }

  void Inspect::operator()(Propset* propset)
  {
    propset->property_fragment()->perform(this);
    append_colon_separator();
    propset->block()->perform(this);
  }

  void Inspect::operator()(Bubble* bubble)
  {
    append_indentation();
    append_token("::BUBBLE", bubble);
    append_scope_opener();
    bubble->node()->perform(this);
    append_scope_closer();
  }

libsass/inspect.hpp  view on Meta::CPAN

    void fallback_impl(AST_Node* n);

  public:

    Inspect(Emitter emi);
    virtual ~Inspect();

    // statements
    virtual void operator()(Block*);
    virtual void operator()(Ruleset*);
    virtual void operator()(Propset*);
    virtual void operator()(Bubble*);
    virtual void operator()(Feature_Block*);
    virtual void operator()(Media_Block*);
    virtual void operator()(At_Root_Block*);
    virtual void operator()(At_Rule*);
    virtual void operator()(Keyframe_Rule*);
    virtual void operator()(Declaration*);
    virtual void operator()(Assignment*);
    virtual void operator()(Import*);
    virtual void operator()(Import_Stub*);

libsass/operation.hpp  view on Meta::CPAN

  using namespace std;

  template<typename T>
  class Operation {
  public:
    virtual T operator()(AST_Node* x)               = 0;
    virtual ~Operation()                            { }
    // statements
    virtual T operator()(Block* x)                  = 0;
    virtual T operator()(Ruleset* x)                = 0;
    virtual T operator()(Propset* x)                = 0;
    virtual T operator()(Bubble* x)                 = 0;
    virtual T operator()(Feature_Block* x)          = 0;
    virtual T operator()(Media_Block* x)            = 0;
    virtual T operator()(At_Root_Block* x)          = 0;
    virtual T operator()(At_Rule* x)                = 0;
    virtual T operator()(Keyframe_Rule* x)          = 0;
    virtual T operator()(Declaration* x)            = 0;
    virtual T operator()(Assignment* x)             = 0;
    virtual T operator()(Import* x)                 = 0;
    virtual T operator()(Import_Stub* x)            = 0;

libsass/operation.hpp  view on Meta::CPAN

  };

  template <typename T, typename D>
  class Operation_CRTP : public Operation<T> {
  public:
    virtual T operator()(AST_Node* x)               { return static_cast<D*>(this)->fallback(x); }
    virtual ~Operation_CRTP()                       = 0;
    // statements
    virtual T operator()(Block* x)                  { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Ruleset* x)                { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Propset* x)                { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Bubble* x)                 { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Feature_Block* x)          { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Media_Block* x)            { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(At_Root_Block* x)          { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(At_Rule* x)                { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Keyframe_Rule* x)          { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Declaration* x)            { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Assignment* x)             { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Import* x)                 { return static_cast<D*>(this)->fallback(x); }
    virtual T operator()(Import_Stub* x)            { return static_cast<D*>(this)->fallback(x); }

libsass/output.hpp  view on Meta::CPAN


  protected:
    string charset;
    vector<Import*> top_imports;
    vector<Comment*> top_comments;

  public:
    OutputBuffer get_buffer(void);

    virtual void operator()(Ruleset*);
    // virtual void operator()(Propset*);
    virtual void operator()(Feature_Block*);
    virtual void operator()(Media_Block*);
    virtual void operator()(At_Rule*);
    virtual void operator()(Keyframe_Rule*);
    virtual void operator()(Import*);
    virtual void operator()(Comment*);
    virtual void operator()(String_Quoted*);
    virtual void operator()(String_Constant*);

    void fallback_impl(AST_Node* n);

libsass/parser.cpp  view on Meta::CPAN

        if (!lex< one_plus< exactly<';'> > >()) error("top-level @import directive must be terminated by ';'", pstate);
      }
      else if (peek< kwd_mixin >() || peek< kwd_function >()) {
        (*root) << parse_definition();
      }
      else if (peek< variable >()) {
        (*root) << parse_assignment();
        if (!lex< one_plus< exactly<';'> > >()) error("top-level variable binding must be terminated by ';'", pstate);
      }
      /*else if (peek< sequence< optional< exactly<'*'> >, alternatives< identifier_schema, identifier >, optional_spaces, exactly<':'>, optional_spaces, exactly<'{'> > >(position)) {
        (*root) << parse_propset();
      }*/
      else if (peek< kwd_include >() /* || peek< exactly<'+'> >() */) {
        Mixin_Call* mixin_call = parse_mixin_call();
        (*root) << mixin_call;
        if (!mixin_call->block() && !lex< one_plus< exactly<';'> > >()) error("top-level @include directive must be terminated by ';'", pstate);
      }
      else if (peek< kwd_if_directive >()) {
        (*root) << parse_if_directive();
      }
      else if (peek< kwd_for_directive >()) {

libsass/parser.cpp  view on Meta::CPAN

    bool is_global = false;
    while (peek< default_flag >() || peek< global_flag >()) {
      is_default = lex< default_flag >() || is_default;
      is_global = lex< global_flag >() || is_global;
    }
    Assignment* var = new (ctx.mem) Assignment(var_source_position, name, val, is_default, is_global);
    return var;
  }

  /* not used anymore - remove?
  Propset* Parser::parse_propset()
  {
    String* property_segment;
    if (peek< sequence< optional< exactly<'*'> >, identifier_schema > >()) {
      property_segment = parse_identifier_schema();
    }
    else {
      lex< sequence< optional< exactly<'*'> >, identifier > >();
      property_segment = new (ctx.mem) String_Quoted(pstate, lexed);
    }
    Propset* propset = new (ctx.mem) Propset(pstate, property_segment);
    lex< exactly<':'> >();

    if (!peek< exactly<'{'> >()) error("expected a '{' after namespaced property", pstate);

    propset->block(parse_block());

    propset->tabs(indentation);

    return propset;
  } */

  Ruleset* Parser::parse_ruleset(Selector_Lookahead lookahead)
  {
    Selector* sel;
    if (lookahead.has_interpolants) {
      sel = parse_selector_schema(lookahead.found);
    }
    else {
      sel = parse_selector_group();

libsass/parser.cpp  view on Meta::CPAN

      }
      else if (peek< at_keyword >()) {
        At_Rule* at_rule = parse_at_rule();
        (*block) << at_rule;
        if (!at_rule->block()) semicolon = true;
      }
      else if ((lookahead_result = lookahead_for_selector(position)).found) {
        (*block) << parse_ruleset(lookahead_result);
      }/* not used anymore - remove?
      else if (peek< sequence< optional< exactly<'*'> >, alternatives< identifier_schema, identifier >, optional_spaces, exactly<':'>, optional_spaces, exactly<'{'> > >(position)) {
        (*block) << parse_propset();
      }*/
      else if (!peek< exactly<';'> >()) {
        bool indent = ! peek< sequence< optional< exactly<'*'> >, alternatives< identifier_schema, identifier >, optional_spaces, exactly<':'>, optional_spaces, exactly<'{'> > >(position);
        /* not used anymore - remove?
        if (peek< sequence< optional< exactly<'*'> >, identifier_schema, exactly<':'>, exactly<'{'> > >()) {
          (*block) << parse_propset();
        }
        else if (peek< sequence< optional< exactly<'*'> >, identifier, exactly<':'>, exactly<'{'> > >()) {
          (*block) << parse_propset();
        }
        else */ {
          Declaration* decl = parse_declaration();
          decl->tabs(indentation);
          (*block) << decl;
          if (peek< exactly<'{'> >()) {
            // parse a propset that rides on the declaration's property
            if (indent) indentation++;
            Propset* ps = new (ctx.mem) Propset(pstate, decl->property(), parse_block());
            if (indent) indentation--;
            (*block) << ps;
          }
          else {
            // finish and let the semicolon get munched
            semicolon = true;
          }
        }
      }
      else lex< one_plus< exactly<';'> > >();

libsass/parser.hpp  view on Meta::CPAN


    Block* parse();
    Import* parse_import();
    Definition* parse_definition();
    Parameters* parse_parameters();
    Parameter* parse_parameter();
    Mixin_Call* parse_mixin_call();
    Arguments* parse_arguments(bool has_url = false);
    Argument* parse_argument(bool has_url = false);
    Assignment* parse_assignment();
    // Propset* parse_propset();
    Ruleset* parse_ruleset(Selector_Lookahead lookahead);
    Selector_Schema* parse_selector_schema(const char* end_of_selector);
    Selector_List* parse_selector_group();
    Complex_Selector* parse_selector_combination();
    Compound_Selector* parse_simple_selector_sequence();
    Simple_Selector* parse_simple_selector();
    Wrapped_Selector* parse_negated_selector();
    Simple_Selector* parse_pseudo_selector();
    Attribute_Selector* parse_attribute_selector();
    Block* parse_block();



( run in 1.370 second using v1.01-cache-2.11-cpan-71847e10f99 )