postcss/sugarss

`offset` is missing from `node.source`

Closed this issue · 4 comments

For example:

end: { column: last[5], line: last[4] },

While the default PostCSS parser for example has:
https://github.com/postcss/postcss/blob/77420d62919b4d53921a113bbc939ad5e5b49fe6/lib/parser.js#L361

  getPosition(offset) {
    let pos = this.input.fromOffset(offset)
    return {
      column: pos.col,
      line: pos.line,
      offset
    }
  }

offset was likely added later in PostCSS and wasn't backported to this syntax.

This is not trivial to fix because the tokenizer also doesn't record the offset values in tokens.
I think this issue is fairly minor, but maybe someone is willing to volunteer their time :) (I don't use sugarss myself)

ai commented

I will also fix sugarss by adding offset

ai commented

Fixed by #108

ai commented

The fix was released in 5.0.

Thank you @ai and @RamazanIttiev 🙇