Blame src/source_map.hpp

Packit Service 7770af
#ifndef SASS_SOURCE_MAP_H
Packit Service 7770af
#define SASS_SOURCE_MAP_H
Packit Service 7770af
Packit Service 7770af
#include <string>
Packit Service 7770af
#include <vector>
Packit Service 7770af
Packit Service 7770af
#include "ast_fwd_decl.hpp"
Packit Service 7770af
#include "base64vlq.hpp"
Packit Service 7770af
#include "position.hpp"
Packit Service 7770af
#include "mapping.hpp"
Packit Service 7770af
Packit Service 7770af
#define VECTOR_PUSH(vec, ins) vec.insert(vec.end(), ins.begin(), ins.end())
Packit Service 7770af
#define VECTOR_UNSHIFT(vec, ins) vec.insert(vec.begin(), ins.begin(), ins.end())
Packit Service 7770af
Packit Service 7770af
namespace Sass {
Packit Service 7770af
Packit Service 7770af
  class Context;
Packit Service 7770af
  class OutputBuffer;
Packit Service 7770af
Packit Service 7770af
  class SourceMap {
Packit Service 7770af
Packit Service 7770af
  public:
Packit Service 7770af
    std::vector<size_t> source_index;
Packit Service 7770af
    SourceMap();
Packit Service 7770af
    SourceMap(const std::string& file);
Packit Service 7770af
Packit Service 7770af
    void append(const Offset& offset);
Packit Service 7770af
    void prepend(const Offset& offset);
Packit Service 7770af
    void append(const OutputBuffer& out);
Packit Service 7770af
    void prepend(const OutputBuffer& out);
Packit Service 7770af
    void add_open_mapping(const AST_Node_Ptr node);
Packit Service 7770af
    void add_close_mapping(const AST_Node_Ptr node);
Packit Service 7770af
Packit Service 7770af
    std::string render_srcmap(Context &ctx;;
Packit Service 7770af
    ParserState remap(const ParserState& pstate);
Packit Service 7770af
Packit Service 7770af
  private:
Packit Service 7770af
Packit Service 7770af
    std::string serialize_mappings();
Packit Service 7770af
Packit Service 7770af
    std::vector<Mapping> mappings;
Packit Service 7770af
    Position current_position;
Packit Service 7770af
public:
Packit Service 7770af
    std::string file;
Packit Service 7770af
private:
Packit Service 7770af
    Base64VLQ base64vlq;
Packit Service 7770af
  };
Packit Service 7770af
Packit Service 7770af
  class OutputBuffer {
Packit Service 7770af
    public:
Packit Service 7770af
      OutputBuffer(void)
Packit Service 7770af
      : buffer(""),
Packit Service 7770af
        smap()
Packit Service 7770af
      { }
Packit Service 7770af
    public:
Packit Service 7770af
      std::string buffer;
Packit Service 7770af
      SourceMap smap;
Packit Service 7770af
  };
Packit Service 7770af
Packit Service 7770af
}
Packit Service 7770af
Packit Service 7770af
#endif