1 #ifndef SASS_BACKTRACE_H
2 #define SASS_BACKTRACE_H
7 #include "position.hpp"
18 Backtrace(Backtrace* prn, ParserState pstate, std::string c)
24 const std::string to_string(bool warning = false)
28 std::string cwd(Sass::File::get_cwd());
29 Backtrace* this_point = this;
31 if (!warning) ss << std::endl << "Backtrace:";
32 // the first tracepoint (which is parent-less) is an empty placeholder
33 while (this_point->parent) {
35 // make path relative to the current directory
36 std::string rel_path(Sass::File::abs2rel(this_point->pstate.path, cwd, cwd));
41 << (++i == 0 ? "on" : "from")
43 << this_point->pstate.line + 1
51 << this_point->pstate.line + 1
52 << this_point->parent->caller;
55 this_point = this_point->parent;
64 Backtrace* p = parent;