Sha256: bdde287204512ff4962b4ae3e2ef7335f4f046a65e8d956bad22e2527311aa80

Contents?: true

Size: 1.85 KB

Versions: 48

Compression:

Stored size: 1.85 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_Ptr, CheckNesting> {

    std::vector<Statement_Ptr>  parents;
    Backtraces                  traces;
    Statement_Ptr               parent;
    Definition_Ptr              current_mixin_definition;

    Statement_Ptr fallback_impl(Statement_Ptr);
    Statement_Ptr before(Statement_Ptr);
    Statement_Ptr visit_children(Statement_Ptr);

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

    Statement_Ptr operator()(Block_Ptr);
    Statement_Ptr operator()(Definition_Ptr);
    Statement_Ptr operator()(If_Ptr);

    template <typename U>
    Statement_Ptr fallback(U x) {
      Statement_Ptr n = Cast<Statement>(x);
      if (this->should_visit(n)) {
        return fallback_impl(n);
      }
      return NULL;
    }

  private:
    void invalid_content_parent(Statement_Ptr, AST_Node_Ptr);
    void invalid_charset_parent(Statement_Ptr, AST_Node_Ptr);
    void invalid_extend_parent(Statement_Ptr, AST_Node_Ptr);
    // void invalid_import_parent(Statement_Ptr);
    void invalid_mixin_definition_parent(Statement_Ptr, AST_Node_Ptr);
    void invalid_function_parent(Statement_Ptr, AST_Node_Ptr);

    void invalid_function_child(Statement_Ptr);
    void invalid_prop_child(Statement_Ptr);
    void invalid_prop_parent(Statement_Ptr, AST_Node_Ptr);
    void invalid_return_parent(Statement_Ptr, AST_Node_Ptr);
    void invalid_value_child(AST_Node_Ptr);

    bool is_transparent_parent(Statement_Ptr, Statement_Ptr);

    bool should_visit(Statement_Ptr);

    bool is_charset(Statement_Ptr);
    bool is_mixin(Statement_Ptr);
    bool is_function(Statement_Ptr);
    bool is_root_node(Statement_Ptr);
    bool is_at_root_node(Statement_Ptr);
    bool is_directive_node(Statement_Ptr);
  };

}

#endif

Version data entries

48 entries across 46 versions & 15 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@rails/webpacker/node_modules/node-sass/src/libsass/src/check_nesting.hpp
optimacms-0.1.61 spec/dummy/node_modules/node-sass/src/libsass/src/check_nesting.hpp
disco_app-0.18.0 test/dummy/node_modules/node-sass/src/libsass/src/check_nesting.hpp
disco_app-0.18.2 test/dummy/node_modules/node-sass/src/libsass/src/check_nesting.hpp
tang-0.2.1 spec/tang_app/node_modules/node-sass/src/libsass/src/check_nesting.hpp
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/node-sass/src/libsass/src/check_nesting.hpp
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/node-sass/src/libsass/src/check_nesting.hpp
ruby2js-4.0.4 lib/tasks/testrails/node_modules/node-sass/src/libsass/src/check_nesting.hpp
ruby2js-4.0.3 lib/tasks/testrails/node_modules/node-sass/src/libsass/src/check_nesting.hpp
tang-0.2.0 spec/tang_app/node_modules/node-sass/src/libsass/src/check_nesting.hpp
tang-0.1.0 spec/tang_app/node_modules/node-sass/src/libsass/src/check_nesting.hpp
tang-0.0.9 spec/tang_app/node_modules/node-sass/src/libsass/src/check_nesting.hpp
enju_library-0.3.8 spec/dummy/node_modules/node-sass/src/libsass/src/check_nesting.hpp
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/sassc-2.0.0/ext/libsass/src/check_nesting.hpp
ilog-0.4.1 node_modules/node-sass/src/libsass/src/check_nesting.hpp
ilog-0.4.0 node_modules/node-sass/src/libsass/src/check_nesting.hpp
ilog-0.3.3 node_modules/node-sass/src/libsass/src/check_nesting.hpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.0.1/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.0.1/ext/libsass/src/check_nesting.hpp
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.0.1/ext/libsass/src/check_nesting.hpp