Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

Immediate child selector (">") breaks parsing #24

Open

Description

According to the docs, this should work:

.some-class {
  > div {
    color: white;
  }
}

However, the parser raises an error:

.some-class {
^
Expected end of text (at char 0), (line:1, col:1)

Simply removing the immediate child selector will make the parser not have any problems, however this then precludes the use of said selector.

This is python-scss version 0.8.71 on Fedora Core 13

Activity

  1. casscauley commented on Dec 23, 2011

    @casscauley

    TLDR; replace " > " with " >" (no space after greater than)

    I tried to play with this a bit but I don't understand pyparsing enough to fix it. I tried a few test cases, and every time it would work if I was lazy, like "i>b{color: red}" and fail when I was not lazy, like "i > b { color: red }". After a bit of trial and error I found that the error is caused by "greater-than space". I then did a find and replace, removing every "> " with ">" and the problem went away. Note, the file I used contains 17 immediate child selectors, so it was tested with a variety of combinations. Hope that holds you over till they fix it.

  2. homeworkprod commented on Jan 15, 2012

    @homeworkprod

    I can reproduce that.

    nav.top,
    body > footer {
      color: #e7e7e7;
    }
    

    blows up complaining:

    nav.top,
       ^
    Expected end of text (at char 3), (line:1, col:4)
    

    while this doesn't:

    nav.top,
    body >footer {
      color: #e7e7e7;
    }
    

    Another example:

    body > footer {
      clear: both;
    }
    

    yields:

    body > footer {
                  ^
    Expected end of text (at char 14), (line:1, col:15)
    

    Even worse:

    #foobar,
    body > footer {
      clear: both;
    }
    

    This results in a misleading error message that doesn't even point to a certain line:

    invalid literal for int() with base 16: 'fo'
    

    This is quite annoying and hurts readability. Also, that's quite an adoption stopper (I encountered it before my stylesheet compiled even once; pyScss had no problem with this, BTW). Please fix this.

  3. klen commented on Jan 23, 2012

    @klen
    Owner

    Sorry, I not supported python-scss anymore. Use https://github.com/Kronuz/pyScss

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions