Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curly bracket detected as endInterpolant #27

Open
nisalikularatne opened this issue Feb 15, 2019 · 1 comment
Open

Curly bracket detected as endInterpolant #27

nisalikularatne opened this issue Feb 15, 2019 · 1 comment

Comments

@nisalikularatne
Copy link

nisalikularatne commented Feb 15, 2019

Hi,

When we tokenize the following example

@mixin bg-variant($parent,$color){
  a#{$parent},
  button#{$parent} {
  }
}

the output returned is

[ [ '@', '@', 1, 1 ],
  [ 'ident', 'mixin', 1, 2, 1, 6 ],
  [ 'space', ' ' ],
  [ 'ident', 'bg-variant', 1, 8, 1, 17 ],
  [ '(', '(', 1, 18 ],
  [ '$', '$', 1, 19 ],
  [ 'ident', 'parent', 1, 20, 1, 25 ],
  [ ',', ',', 1, 26 ],
  [ '$', '$', 1, 27 ],
  [ 'ident', 'color', 1, 28, 1, 32 ],
  [ ')', ')', 1, 33 ],
  [ '{', '{', 1, 34 ],
  [ 'newline', '\n', 2, 0 ],
  [ 'space', '  ' ],
  [ 'ident', 'a', 2, 3, 2, 3 ],
  [ 'startInterpolant', '#{', 2, 5 ],
  [ '$', '$', 2, 6 ],
  [ 'ident', 'parent', 2, 7, 2, 12 ],
  [ 'endInterpolant', '}', 2, 13 ],
  [ ',', ',', 2, 14 ],
  [ 'newline', '\n', 3, 0 ],
  [ 'space', '  ' ],
  [ 'ident', 'button', 3, 3, 3, 8 ],
  [ 'startInterpolant', '#{', 3, 10 ],
  [ '$', '$', 3, 11 ],
  [ 'ident', 'parent', 3, 12, 3, 17 ],
  [ 'endInterpolant', '}', 3, 18 ],
  [ 'space', ' ' ],
  [ '{', '{', 3, 20 ],
  [ 'newline', '\n', 4, 0 ],
  [ 'space', '  ' ],
  [ 'endInterpolant', '}', 4, 3 ],
  [ 'newline', '\n', 5, 0 ],
  [ '}', '}', 5, 1 ] ]

The tokenizer detects the second last curly bracket '}' as an endInterpolant token.
Any idea on how it can be solved ?

Thank you

@xzyfer
Copy link
Member

xzyfer commented Feb 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants