Skip to content

Commit

Permalink
More clean ups [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed May 17, 2015
1 parent a81dad6 commit a9f2ca6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
9 changes: 3 additions & 6 deletions eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include "util.hpp"
#include "to_string.hpp"
#include "inspect.hpp"
#include "environment.hpp"
#include "position.hpp"
#include "sass_values.h"
#include "to_c.hpp"
#include "context.hpp"
#include "backtrace.hpp"
Expand All @@ -33,12 +36,6 @@ namespace Sass {
add, sub, mul, div, fmod
};

Eval::Eval(Eval* eval)
: exp(eval->exp),
ctx(eval->ctx),
listize(eval->listize)
{ }

Eval::Eval(Expand& exp)
: exp(exp),
ctx(exp.ctx),
Expand Down
29 changes: 9 additions & 20 deletions eval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,27 @@
#define SASS_EVAL_H

#include <iostream>

#include "context.hpp"
#include "position.hpp"
#include "operation.hpp"
#include "environment.hpp"
#include "listize.hpp"
#include "sass_values.h"

#include "operation.hpp"

namespace Sass {
using namespace std;

typedef Environment<AST_Node*> Env;
struct Backtrace;
class Listize;
class Expand;
class Context;
class Listize;

class Eval : public Operation_CRTP<Expression*, Eval> {


private:
string interpolation(Expression* s);
Expression* fallback_impl(AST_Node* n);

public:
Expand& exp;
Context& ctx;
Listize listize;
Eval(Eval* eval);
public:
Expand& exp;
Context& ctx;
Listize listize;
Eval(Expand& exp);
virtual ~Eval();

Expand All @@ -37,7 +31,6 @@ namespace Sass {
Selector* selector();
Backtrace* stacktrace();

Eval* snapshot(); // for setting the env before eval'ing an expression
using Operation<Expression*>::operator();

// for evaluating function bodies
Expand Down Expand Up @@ -87,13 +80,9 @@ namespace Sass {
Expression* operator()(Parent_Selector*);
Expression* operator()(Attribute_Selector*);


template <typename U>
Expression* fallback(U x) { return fallback_impl(x); }

private:
string interpolation(Expression* s);

};

Expression* cval_to_astnode(Sass_Value* v, Context& ctx, Backtrace* backtrace, ParserState pstate = ParserState("[AST]"));
Expand Down
4 changes: 4 additions & 0 deletions sass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include "file.hpp"
#include "util.hpp"

#ifdef _MSC_VER
#define LIBSASS_VERSION "1.0.0"
#endif

extern "C" {
using namespace std;
using namespace Sass;
Expand Down

0 comments on commit a9f2ca6

Please sign in to comment.