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

extra comma after rule should raise syntax error but compiles unnoticed #2365

Closed
NickWhiu opened this issue May 2, 2017 · 1 comment
Closed

Comments

@NickWhiu
Copy link

NickWhiu commented May 2, 2017

extra comma after rule should raise syntax error but compiles unnoticed

When there is a comma after a rule (a syntax error) libsass appears to compile happily anyway, producing unexpected output when a syntax error should be raised. Notice the comma after the b{ ... } rule.

I tried this example with sassc after noticing this with a tool that uses node-sass. With the (official?) sass command line tool, it is correctly reported as a syntax error.

input.scss

a {
    b {
        color: red;
    },
    c {
        color: blue;
    }
}

[Expected output]

Error: Invalid CSS after rule:  expected selector, was "," on line 4

[Actual output - with sassc 3.5.0]

a b {
  color: red; }

a,
a c {
  color: blue; }

version info:

sassc           3.4.1-5-g5909-dirty
libsass        3.5.0.beta.3-25-ge14ca

Cheers,
love your work

@NickWhiu NickWhiu changed the title extra comma after rule should raise syntax error but compiles unnoticed to unexpected output instead extra comma after rule should raise syntax error but compiles unnoticed May 2, 2017
mgreter added a commit to mgreter/libsass that referenced this issue May 20, 2017
mgreter added a commit to mgreter/sass-spec that referenced this issue May 20, 2017
mgreter added a commit to mgreter/sass-spec that referenced this issue May 20, 2017
@mgreter mgreter self-assigned this May 20, 2017
mgreter added a commit that referenced this issue May 20, 2017
Error for trailing rulesets comma (#2365)
mgreter added a commit to mgreter/sass-spec that referenced this issue May 20, 2017
@mgreter
Copy link
Contributor

mgreter commented May 20, 2017

This is fixed by #2389

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

No branches or pull requests

2 participants