Skip to content

Commit

Permalink
Add refactor for C++ context
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Nov 1, 2015
1 parent a91e43d commit 610acbf
Show file tree
Hide file tree
Showing 18 changed files with 591 additions and 541 deletions.
24 changes: 15 additions & 9 deletions src/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,26 +538,32 @@ namespace Sass {
// necessary to store a list of each in an Import node.
////////////////////////////////////////////////////////////////////////////
class Import : public Statement {
std::vector<std::string> files_;
std::vector<Expression*> urls_;
ADD_PROPERTY(List*, media_queries);
std::vector<Expression*> urls_;
std::vector<Include> incs_;
ADD_PROPERTY(List*, media_queries);
public:
Import(ParserState pstate)
: Statement(pstate),
files_(std::vector<std::string>()),
urls_(std::vector<Expression*>()),
incs_(std::vector<Include>()),
media_queries_(0)
{ statement_type(IMPORT); }
std::vector<std::string>& files() { return files_; }
std::vector<Expression*>& urls() { return urls_; }
std::vector<Expression*>& urls() { return urls_; }
std::vector<Include>& incs() { return incs_; }
ATTACH_OPERATIONS()
};

// not yet resolved single import
// so far we only know requested name
class Import_Stub : public Statement {
ADD_PROPERTY(std::string, file_name)
Include resource_;
public:
Import_Stub(ParserState pstate, std::string f)
: Statement(pstate), file_name_(f)
std::string abs_path() { return resource_.abs_path; };
std::string imp_path() { return resource_.imp_path; };
Include resource() { return resource_; };

Import_Stub(ParserState pstate, Include res)
: Statement(pstate), resource_(res)
{ statement_type(IMPORT_STUB); }
ATTACH_OPERATIONS()
};
Expand Down
3 changes: 3 additions & 0 deletions src/ast_fwd_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ namespace Sass {
class Complex_Selector;
class Selector_List;

// common classes
class Context;

}

#endif
Loading

0 comments on commit 610acbf

Please sign in to comment.