Sha256: 2a6f8a137bde6d82785ba934c08ece9e11413bd9b1a0fc14d9089397f2130bdf

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

#ifndef SASS_TO_VALUE_H
#define SASS_TO_VALUE_H

#include "operation.hpp"
#include "sass/values.h"
#include "ast_fwd_decl.hpp"

namespace Sass {

  class To_Value : public Operation_CRTP<Value*, To_Value> {

    Value* fallback_impl(AST_Node* n);

  private:

    Context& ctx;
    Memory_Manager& mem;

  public:

    To_Value(Context& ctx, Memory_Manager& mem)
    : ctx(ctx), mem(mem)
    { }
    virtual ~To_Value() { }
    using Operation<Value*>::operator();

    Value* operator()(Argument*);
    Value* operator()(Boolean*);
    Value* operator()(Number*);
    Value* operator()(Color*);
    Value* operator()(String_Constant*);
    Value* operator()(String_Quoted*);
    Value* operator()(Custom_Warning*);
    Value* operator()(Custom_Error*);
    Value* operator()(List*);
    Value* operator()(Map*);
    Value* operator()(Null*);

    // convert to string via `To_String`
    Value* operator()(Selector_List*);
    Value* operator()(Binary_Expression*);

    // fallback throws error
    template <typename U>
    Value* fallback(U x) { return fallback_impl(x); }
  };

}

#endif

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sassc-1.8.3 ext/libsass/src/to_value.hpp
sassc-1.8.2 ext/libsass/src/to_value.hpp
sassc-1.8.1 ext/libsass/src/to_value.hpp
sassc-1.8.0 ext/libsass/src/to_value.hpp
sassc-1.8.0.pre2 ext/libsass/src/to_value.hpp
sassc-1.8.0.pre1 ext/libsass/src/to_value.hpp