From a9f2ca658d33f4b56d8e3de068680edb62cf8e90 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Mon, 18 May 2015 00:48:01 +0200 Subject: [PATCH] More clean ups [WIP] --- eval.cpp | 9 +++------ eval.hpp | 29 +++++++++-------------------- sass.cpp | 4 ++++ 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/eval.cpp b/eval.cpp index 6511fdc93b..bd728739e6 100644 --- a/eval.cpp +++ b/eval.cpp @@ -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" @@ -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), diff --git a/eval.hpp b/eval.hpp index 4b35b039e7..42b15ba60c 100644 --- a/eval.hpp +++ b/eval.hpp @@ -2,33 +2,27 @@ #define SASS_EVAL_H #include - #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 Env; - struct Backtrace; - class Listize; class Expand; + class Context; + class Listize; class Eval : public Operation_CRTP { - + 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(); @@ -37,7 +31,6 @@ namespace Sass { Selector* selector(); Backtrace* stacktrace(); - Eval* snapshot(); // for setting the env before eval'ing an expression using Operation::operator(); // for evaluating function bodies @@ -87,13 +80,9 @@ namespace Sass { Expression* operator()(Parent_Selector*); Expression* operator()(Attribute_Selector*); - template 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]")); diff --git a/sass.cpp b/sass.cpp index dbec8dacad..bc73a99aa2 100644 --- a/sass.cpp +++ b/sass.cpp @@ -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;