Skip to content

Commit

Permalink
Merge pull request #1510 from mgreter/bugfix/source-map-lex-back
Browse files Browse the repository at this point in the history
Fix source-map bug introduces with some recent commit
  • Loading branch information
xzyfer committed Sep 1, 2015
2 parents 9ed6324 + b0fa00e commit 702ac5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parser.hpp
Expand Up @@ -168,15 +168,21 @@ namespace Sass {
Token prev = lexed;
// store previous pointer
const char* oldpos = position;
Position bt = before_token;
Position at = after_token;
ParserState op = pstate;
// throw away comments
// update srcmap position
lex < Prelexer::css_comments >();
// now lex a new token
const char* pos = lex< mx >();
// maybe restore prev state
if (pos == 0) {
pstate = op;
lexed = prev;
position = oldpos;
after_token = at;
before_token = bt;
}
// return match
return pos;
Expand Down

0 comments on commit 702ac5a

Please sign in to comment.