sasstools / scss-tokenizer

A tokenzier for Sass' SCSS syntax
MIT License
24 stars 22 forks source link

Invalid tokenization inside interpolent #26

Open Ali-Dalal opened 5 years ago

Ali-Dalal commented 5 years ago

Hi

Tokenizing this example

$input-height-inner-quarter:#{$input-padding-y / 2} !default;

will return

[ [ '$', '$', 1, 1 ],
  [ 'ident', 'input-height-inner-quarter', 1, 2, 1, 27 ],
  [ ':', ':', 1, 28 ],
  [ 'startInterpolant', '#{', 1, 30 ],
  [ '$', '$', 1, 31 ],
  [ 'ident', 'input-padding-y', 1, 32, 1, 46 ],
  [ 'space', ' ' ],
  [ '/', '/', 1, 48 ],
  [ 'endInterpolant', '}', 1, 51 ],
  [ 'space', ' ' ],
  [ 'word', '!default', 1, 53, 1, 60 ],
  [ ';', ';', 1, 61 ] ]

The tokenizer didn't detect "2} "

any thoughts about this?

Thanks

xzyfer commented 5 years ago

Sounds like a bug. I can take a look next week.

I'm curious to know what your use case for this library?

On Wed., 13 Feb. 2019, 7:27 pm Ali Dalal <notifications@github.com wrote:

Hi

Tokenizing this example

$input-height-inner-quarter:#{$input-padding-y / 2} !default;

will return

[ [ '$', '$', 1, 1 ], [ 'ident', 'input-height-inner-quarter', 1, 2, 1, 27 ], [ ':', ':', 1, 28 ], [ 'startInterpolant', '#{', 1, 30 ], [ '$', '$', 1, 31 ], [ 'ident', 'input-padding-y', 1, 32, 1, 46 ], [ 'space', ' ' ], [ '/', '/', 1, 48 ], [ 'endInterpolant', '}', 1, 51 ], [ 'space', ' ' ], [ 'word', '!default', 1, 53, 1, 60 ], [ ';', ';', 1, 61 ] ]

The tokenizer didn't detect "2} "

any thoughts about this?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sasstools/scss-tokenizer/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjZWO8IoShK1i_QzO0t2auY56VhwfsLks5vM8x6gaJpZM4a42-_ .

Ali-Dalal commented 5 years ago

Hi @xzyfer

I am interpreting the SASS and process some of the tokens to produce a new SASS output which helps in editing some of the SASS and CSS variables through the UI