From 7cb696a768e2e05669342e4a4924519b55a4e5d5 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Sat, 17 Mar 2018 02:52:31 +0100 Subject: [PATCH] Rename stacks to use shorter typedefs --- src/ast.cpp | 4 ++-- src/ast.hpp | 6 +++--- src/ast_fwd_decl.hpp | 2 +- src/context.hpp | 4 ++-- src/cssize.cpp | 2 +- src/cssize.hpp | 2 +- src/eval.cpp | 2 +- src/expand.cpp | 10 +++++----- src/expand.hpp | 10 +++++----- src/fn_utils.hpp | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/ast.cpp b/src/ast.cpp index c3b38efb9..341cbc3fb 100644 --- a/src/ast.cpp +++ b/src/ast.cpp @@ -1259,7 +1259,7 @@ namespace Sass { return list; } - Selector_List_Ptr Selector_List::resolve_parent_refs(std::vector& 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()); @@ -1273,7 +1273,7 @@ namespace Sass { return ss; } - Selector_List_Ptr Complex_Selector::resolve_parent_refs(std::vector& 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(); diff --git a/src/ast.hpp b/src/ast.hpp index 07728103e..e5b0f06d9 100644 --- a/src/ast.hpp +++ b/src/ast.hpp @@ -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); + typedef Expression_Ptr (*Native_Function)(Env&, Env&, Context&, Signature, ParserState, Backtraces, SelectorStack); class Definition : public Has_Block { public: enum Type { MIXIN, FUNCTION }; @@ -2860,7 +2860,7 @@ namespace Sass { Complex_Selector_Obj innermost() { return last(); }; size_t length() const; - Selector_List_Ptr resolve_parent_refs(std::vector& 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 = ""); @@ -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& 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 = ""); diff --git a/src/ast_fwd_decl.hpp b/src/ast_fwd_decl.hpp index 4a3ff69b1..90c362310 100644 --- a/src/ast_fwd_decl.hpp +++ b/src/ast_fwd_decl.hpp @@ -423,7 +423,7 @@ namespace Sass { typedef std::vector CallStack; typedef std::vector MediaStack; typedef std::vector SelectorStack; - typedef std::vector* ImporterStack; + typedef std::vector ImporterStack; typedef const char* Signature; diff --git a/src/context.hpp b/src/context.hpp index d3caba13e..027ffca22 100644 --- a/src/context.hpp +++ b/src/context.hpp @@ -46,14 +46,14 @@ namespace Sass { // generic ast node garbage container // used to avoid possible circular refs - std::vector ast_gc; + CallStack ast_gc; // resources add under our control // these are guaranteed to be freed std::vector strings; std::vector resources; std::map sheets; Subset_Map subset_map; - std::vector import_stack; + ImporterStack import_stack; std::vector callee_stack; std::vector traces; diff --git a/src/cssize.cpp b/src/cssize.cpp index 4c062a628..d5780dd70 100644 --- a/src/cssize.cpp +++ b/src/cssize.cpp @@ -11,7 +11,7 @@ namespace Sass { Cssize::Cssize(Context& ctx) : ctx(ctx), traces(ctx.traces), - block_stack(std::vector()), + block_stack(BlockStack()), p_stack(std::vector()) { } diff --git a/src/cssize.hpp b/src/cssize.hpp index 5a6c704b0..4dad47579 100644 --- a/src/cssize.hpp +++ b/src/cssize.hpp @@ -14,7 +14,7 @@ namespace Sass { Context& ctx; Backtraces& traces; - std::vector block_stack; + BlockStack block_stack; std::vector p_stack; Statement_Ptr fallback_impl(AST_Node_Ptr n); diff --git a/src/eval.cpp b/src/eval.cpp index 2ddfa93ea..010cb9bb9 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -1529,7 +1529,7 @@ namespace Sass { Selector_List_Ptr Eval::operator()(Selector_List_Ptr s) { - std::vector 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()); diff --git a/src/expand.cpp b/src/expand.cpp index ccd2822df..0bf0b78eb 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -16,7 +16,7 @@ namespace Sass { // simple endless recursion protection const size_t maxRecursion = 500; - Expand::Expand(Context& ctx, Env* env, std::vector* stack) + Expand::Expand(Context& ctx, Env* env, SelectorStack* stack) : ctx(ctx), traces(ctx.traces), eval(Eval(*this)), @@ -25,10 +25,10 @@ namespace Sass { at_root_without_rule(false), old_at_root_without_rule(false), env_stack(std::vector()), - block_stack(std::vector()), - call_stack(std::vector()), - selector_stack(std::vector()), - media_block_stack(std::vector()) + block_stack(BlockStack()), + call_stack(CallStack()), + selector_stack(SelectorStack()), + media_block_stack(MediaStack()) { env_stack.push_back(0); env_stack.push_back(env); diff --git a/src/expand.hpp b/src/expand.hpp index 3464c98f6..3d6d1eb6b 100644 --- a/src/expand.hpp +++ b/src/expand.hpp @@ -31,10 +31,10 @@ namespace Sass { // it's easier to work with vectors std::vector env_stack; - std::vector block_stack; - std::vector call_stack; - std::vector selector_stack; - std::vector media_block_stack; + BlockStack block_stack; + CallStack call_stack; + SelectorStack selector_stack; + MediaStack media_block_stack; Boolean_Obj bool_true; @@ -44,7 +44,7 @@ namespace Sass { void expand_selector_list(Selector_Obj, Selector_List_Obj extender); public: - Expand(Context&, Env*, std::vector* stack = NULL); + Expand(Context&, Env*, SelectorStack* stack = NULL); ~Expand() { } Block_Ptr operator()(Block_Ptr); diff --git a/src/fn_utils.hpp b/src/fn_utils.hpp index b6ce97d17..ab03bbf4f 100644 --- a/src/fn_utils.hpp +++ b/src/fn_utils.hpp @@ -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_stack) + name(Env& env, Env& d_env, Context& ctx, Signature sig, ParserState pstate, Backtraces traces, SelectorStack selector_stack) #define ARG(argname, argtype) get_arg(argname, env, sig, pstate, traces)