Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Rename stacks to use shorter typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Mar 17, 2018
1 parent c1b3676 commit 7cb696a
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ namespace Sass {
return list;
}

Selector_List_Ptr Selector_List::resolve_parent_refs(std::vector<Selector_List_Obj>& pstack, Backtraces& traces, bool implicit_parent)
Selector_List_Ptr Selector_List::resolve_parent_refs(SelectorStack& pstack, Backtraces& traces, bool implicit_parent)
{
if (!this->has_parent_ref()) return this;
Selector_List_Ptr ss = SASS_MEMORY_NEW(Selector_List, pstate());
Expand All @@ -1273,7 +1273,7 @@ namespace Sass {
return ss;
}

Selector_List_Ptr Complex_Selector::resolve_parent_refs(std::vector<Selector_List_Obj>& pstack, Backtraces& traces, bool implicit_parent)
Selector_List_Ptr Complex_Selector::resolve_parent_refs(SelectorStack& pstack, Backtraces& traces, bool implicit_parent)
{
Complex_Selector_Obj tail = this->tail();
Compound_Selector_Obj head = this->head();
Expand Down
6 changes: 3 additions & 3 deletions src/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ namespace Sass {
// by a type tag.
/////////////////////////////////////////////////////////////////////////////
struct Backtrace;
typedef Expression_Ptr (*Native_Function)(Env&, Env&, Context&, Signature, ParserState, Backtraces, std::vector<Selector_List_Obj>);
typedef Expression_Ptr (*Native_Function)(Env&, Env&, Context&, Signature, ParserState, Backtraces, SelectorStack);
class Definition : public Has_Block {
public:
enum Type { MIXIN, FUNCTION };
Expand Down Expand Up @@ -2860,7 +2860,7 @@ namespace Sass {
Complex_Selector_Obj innermost() { return last(); };

size_t length() const;
Selector_List_Ptr resolve_parent_refs(std::vector<Selector_List_Obj>& pstack, Backtraces& traces, bool implicit_parent = true);
Selector_List_Ptr resolve_parent_refs(SelectorStack& pstack, Backtraces& traces, bool implicit_parent = true);
virtual bool is_superselector_of(Compound_Selector_Obj sub, std::string wrapping = "");
virtual bool is_superselector_of(Complex_Selector_Obj sub, std::string wrapping = "");
virtual bool is_superselector_of(Selector_List_Obj sub, std::string wrapping = "");
Expand Down Expand Up @@ -2982,7 +2982,7 @@ namespace Sass {
virtual bool has_parent_ref() const;
virtual bool has_real_parent_ref() const;
void remove_parent_selectors();
Selector_List_Ptr resolve_parent_refs(std::vector<Selector_List_Obj>& pstack, Backtraces& traces, bool implicit_parent = true);
Selector_List_Ptr resolve_parent_refs(SelectorStack& pstack, Backtraces& traces, bool implicit_parent = true);
virtual bool is_superselector_of(Compound_Selector_Obj sub, std::string wrapping = "");
virtual bool is_superselector_of(Complex_Selector_Obj sub, std::string wrapping = "");
virtual bool is_superselector_of(Selector_List_Obj sub, std::string wrapping = "");
Expand Down
2 changes: 1 addition & 1 deletion src/ast_fwd_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ namespace Sass {
typedef std::vector<AST_Node_Obj> CallStack;
typedef std::vector<Media_Block_Ptr> MediaStack;
typedef std::vector<Selector_List_Obj> SelectorStack;
typedef std::vector<Sass_Import_Entry>* ImporterStack;
typedef std::vector<Sass_Import_Entry> ImporterStack;

typedef const char* Signature;

Expand Down
4 changes: 2 additions & 2 deletions src/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ namespace Sass {

// generic ast node garbage container
// used to avoid possible circular refs
std::vector<AST_Node_Obj> ast_gc;
CallStack ast_gc;
// resources add under our control
// these are guaranteed to be freed
std::vector<char*> strings;
std::vector<Resource> resources;
std::map<const std::string, StyleSheet> sheets;
Subset_Map subset_map;
std::vector<Sass_Import_Entry> import_stack;
ImporterStack import_stack;
std::vector<Sass_Callee> callee_stack;
std::vector<Backtrace> traces;

Expand Down
2 changes: 1 addition & 1 deletion src/cssize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Sass {
Cssize::Cssize(Context& ctx)
: ctx(ctx),
traces(ctx.traces),
block_stack(std::vector<Block_Ptr>()),
block_stack(BlockStack()),
p_stack(std::vector<Statement_Ptr>())
{ }

Expand Down
2 changes: 1 addition & 1 deletion src/cssize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Sass {

Context& ctx;
Backtraces& traces;
std::vector<Block_Ptr> block_stack;
BlockStack block_stack;
std::vector<Statement_Ptr> p_stack;

Statement_Ptr fallback_impl(AST_Node_Ptr n);
Expand Down
2 changes: 1 addition & 1 deletion src/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ namespace Sass {

Selector_List_Ptr Eval::operator()(Selector_List_Ptr s)
{
std::vector<Selector_List_Obj> rv;
SelectorStack rv;
Selector_List_Obj sl = SASS_MEMORY_NEW(Selector_List, s->pstate());
sl->is_optional(s->is_optional());
sl->media_block(s->media_block());
Expand Down
10 changes: 5 additions & 5 deletions src/expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Sass {
// simple endless recursion protection
const size_t maxRecursion = 500;

Expand::Expand(Context& ctx, Env* env, std::vector<Selector_List_Obj>* stack)
Expand::Expand(Context& ctx, Env* env, SelectorStack* stack)
: ctx(ctx),
traces(ctx.traces),
eval(Eval(*this)),
Expand All @@ -25,10 +25,10 @@ namespace Sass {
at_root_without_rule(false),
old_at_root_without_rule(false),
env_stack(std::vector<Env*>()),
block_stack(std::vector<Block_Ptr>()),
call_stack(std::vector<AST_Node_Obj>()),
selector_stack(std::vector<Selector_List_Obj>()),
media_block_stack(std::vector<Media_Block_Ptr>())
block_stack(BlockStack()),
call_stack(CallStack()),
selector_stack(SelectorStack()),
media_block_stack(MediaStack())
{
env_stack.push_back(0);
env_stack.push_back(env);
Expand Down
10 changes: 5 additions & 5 deletions src/expand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ namespace Sass {

// it's easier to work with vectors
std::vector<Env*> env_stack;
std::vector<Block_Ptr> block_stack;
std::vector<AST_Node_Obj> call_stack;
std::vector<Selector_List_Obj> selector_stack;
std::vector<Media_Block_Ptr> media_block_stack;
BlockStack block_stack;
CallStack call_stack;
SelectorStack selector_stack;
MediaStack media_block_stack;

Boolean_Obj bool_true;

Expand All @@ -44,7 +44,7 @@ namespace Sass {
void expand_selector_list(Selector_Obj, Selector_List_Obj extender);

public:
Expand(Context&, Env*, std::vector<Selector_List_Obj>* stack = NULL);
Expand(Context&, Env*, SelectorStack* stack = NULL);
~Expand() { }

Block_Ptr operator()(Block_Ptr);
Expand Down
2 changes: 1 addition & 1 deletion src/fn_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Sass {

#define BUILT_IN(name) Expression_Ptr \
name(Env& env, Env& d_env, Context& ctx, Signature sig, ParserState pstate, Backtraces traces, std::vector<Selector_List_Obj> selector_stack)
name(Env& env, Env& d_env, Context& ctx, Signature sig, ParserState pstate, Backtraces traces, SelectorStack selector_stack)

#define ARG(argname, argtype) get_arg<argtype>(argname, env, sig, pstate, traces)

Expand Down

0 comments on commit 7cb696a

Please sign in to comment.