Sha256: 0663f65dedf9452b4d2d2573fe71d3b097682933612c2d82a5984e5a0f8d0925

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

#include "backtrace.hpp"

namespace Sass {

  const std::string traces_to_string(Backtraces traces, std::string indent) {

    std::stringstream ss;
    std::string cwd(File::get_cwd());

    bool first = true;
    size_t i_beg = traces.size() - 1;
    size_t i_end = std::string::npos;
    for (size_t i = i_beg; i != i_end; i --) {

      const Backtrace& trace = traces[i];

      // make path relative to the current directory
      std::string rel_path(File::abs2rel(trace.pstate.path, cwd, cwd));

      // skip functions on error cases (unsure why ruby sass does this)
      // if (trace.caller.substr(0, 6) == ", in f") continue;

      if (first) {
        ss << indent;
        ss << "on line ";
        ss << trace.pstate.line + 1;
        ss << ":";
        ss << trace.pstate.column + 1;
        ss << " of " << rel_path;
        // ss << trace.caller;
        first = false;
      } else {
        ss << trace.caller;
        ss << std::endl;
        ss << indent;
        ss << "from line ";
        ss << trace.pstate.line + 1;
        ss << ":";
        ss << trace.pstate.column + 1;
        ss << " of " << rel_path;
      }

    }

    ss << std::endl;
    return ss.str();

  }

};

Version data entries

26 entries across 17 versions & 2 rubygems

Version Path
sassc-2.3.0 ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/backtrace.cpp
sassc-2.2.1 ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/sassc-2.2.0/ext/libsass/src/backtrace.cpp
sassc-2.2.0 ext/libsass/src/backtrace.cpp
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/backtrace.cpp
sassc-2.1.0-x86_64-linux ext/libsass/src/backtrace.cpp
sassc-2.1.0 ext/libsass/src/backtrace.cpp