Blame src/to_value.hpp

Packit Service 7770af
#ifndef SASS_TO_VALUE_H
Packit Service 7770af
#define SASS_TO_VALUE_H
Packit Service 7770af
Packit Service 7770af
#include "operation.hpp"
Packit Service 7770af
#include "sass/values.h"
Packit Service 7770af
#include "ast_fwd_decl.hpp"
Packit Service 7770af
Packit Service 7770af
namespace Sass {
Packit Service 7770af
Packit Service 7770af
  class To_Value : public Operation_CRTP<Value_Ptr, To_Value> {
Packit Service 7770af
Packit Service 7770af
    Value_Ptr fallback_impl(AST_Node_Ptr n);
Packit Service 7770af
Packit Service 7770af
  private:
Packit Service 7770af
Packit Service 7770af
    Context& ctx;
Packit Service 7770af
Packit Service 7770af
  public:
Packit Service 7770af
Packit Service 7770af
    To_Value(Context& ctx)
Packit Service 7770af
    : ctx(ctx)
Packit Service 7770af
    { }
Packit Service 7770af
    ~To_Value() { }
Packit Service 7770af
    using Operation<Value_Ptr>::operator();
Packit Service 7770af
Packit Service 7770af
    Value_Ptr operator()(Argument_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Boolean_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Number_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Color_Ptr);
Packit Service 7770af
    Value_Ptr operator()(String_Constant_Ptr);
Packit Service 7770af
    Value_Ptr operator()(String_Quoted_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Custom_Warning_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Custom_Error_Ptr);
Packit Service 7770af
    Value_Ptr operator()(List_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Map_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Null_Ptr);
Packit Service 7770af
Packit Service 7770af
    // convert to string via `To_String`
Packit Service 7770af
    Value_Ptr operator()(Selector_List_Ptr);
Packit Service 7770af
    Value_Ptr operator()(Binary_Expression_Ptr);
Packit Service 7770af
Packit Service 7770af
    // fallback throws error
Packit Service 7770af
    template <typename U>
Packit Service 7770af
    Value_Ptr fallback(U x) { return fallback_impl(x); }
Packit Service 7770af
  };
Packit Service 7770af
Packit Service 7770af
}
Packit Service 7770af
Packit Service 7770af
#endif