Skip to content

Commit

Permalink
Remove obsolete token from source span
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Nov 15, 2019
1 parent aada71e commit a96e90e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ namespace Sass {
after_token.add(it_before_token, it_after_token);

// ToDo: could probably do this incremental on original object (API wants offset?)
pstate = SourceSpan(path, source, lexed, before_token, after_token - before_token);
pstate = SourceSpan(path, source, before_token, after_token - before_token);

// advance internal char iterator
return position = it_after_token;
Expand Down
7 changes: 2 additions & 5 deletions src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,10 @@ namespace Sass {


SourceSpan::SourceSpan(const char* path, const char* src, const size_t file)
: Position(file, 0, 0), path(path), src(src), offset(0, 0), token() { }
: Position(file, 0, 0), path(path), src(src), offset(0, 0) { }

SourceSpan::SourceSpan(const char* path, const char* src, const Position& position, Offset offset)
: Position(position), path(path), src(src), offset(offset), token() { }

SourceSpan::SourceSpan(const char* path, const char* src, const Token& token, const Position& position, Offset offset)
: Position(position), path(path), src(src), offset(offset), token(token) { }
: Position(position), path(path), src(src), offset(offset) { }

Position Position::add(const char* begin, const char* end)
{
Expand Down
2 changes: 0 additions & 2 deletions src/position.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ namespace Sass {
public: // c-tor
SourceSpan(const char* path, const char* src = 0, const size_t file = sass::string::npos);
SourceSpan(const char* path, const char* src, const Position& position, Offset offset = Offset(0, 0));
SourceSpan(const char* path, const char* src, const Token& token, const Position& position, Offset offset = Offset(0, 0));

public: // down casts
Offset off() { return *this; }
Expand All @@ -115,7 +114,6 @@ namespace Sass {
const char* path;
const char* src;
Offset offset;
Token token;

};

Expand Down

0 comments on commit a96e90e

Please sign in to comment.