Sha256: 1eaa14a85b0d16cd8fb2fcb07b25109580bd8331f3b0eb228aa1ba6500adfdf0

Contents?: true

Size: 1.77 KB

Versions: 25

Compression:

Stored size: 1.77 KB

Contents

#ifndef SASS_CHECK_NESTING_H
#define SASS_CHECK_NESTING_H

#include "ast.hpp"
#include "operation.hpp"

namespace Sass {

  class CheckNesting : public Operation_CRTP<Statement*, CheckNesting> {

    std::vector<Statement*>  parents;
    Backtraces                  traces;
    Statement*               parent;
    Definition*              current_mixin_definition;

    Statement* before(Statement*);
    Statement* visit_children(Statement*);

  public:
    CheckNesting();
    ~CheckNesting() { }

    Statement* operator()(Block*);
    Statement* operator()(Definition*);
    Statement* operator()(If*);

    template <typename U>
    Statement* fallback(U x) {
      Statement* s = Cast<Statement>(x);
      if (s && this->should_visit(s)) {
        Block* b1 = Cast<Block>(s);
        Has_Block* b2 = Cast<Has_Block>(s);
        if (b1 || b2) return visit_children(s);
      }
      return s;
    }

  private:
    void invalid_content_parent(Statement*, AST_Node*);
    void invalid_charset_parent(Statement*, AST_Node*);
    void invalid_extend_parent(Statement*, AST_Node*);
    // void invalid_import_parent(Statement*);
    void invalid_mixin_definition_parent(Statement*, AST_Node*);
    void invalid_function_parent(Statement*, AST_Node*);

    void invalid_function_child(Statement*);
    void invalid_prop_child(Statement*);
    void invalid_prop_parent(Statement*, AST_Node*);
    void invalid_return_parent(Statement*, AST_Node*);
    void invalid_value_child(AST_Node*);

    bool is_transparent_parent(Statement*, Statement*);

    bool should_visit(Statement*);

    bool is_charset(Statement*);
    bool is_mixin(Statement*);
    bool is_function(Statement*);
    bool is_root_node(Statement*);
    bool is_at_root_node(Statement*);
    bool is_directive_node(Statement*);
  };

}

#endif

Version data entries

25 entries across 16 versions & 2 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/check_nesting.hpp
sassc-2.2.1 ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/check_nesting.hpp
sassc-2.2.0 ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/check_nesting.hpp
sassc-2.1.0-x86_64-linux ext/libsass/src/check_nesting.hpp
sassc-2.1.0 ext/libsass/src/check_nesting.hpp
sassc-2.1.0.pre3-x86_64-linux ext/libsass/src/check_nesting.hpp