Skip to content

Fixed bug when the parser stopped working met statement unnamed. #50

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

Closed
wants to merge 3 commits into from
Closed

Fixed bug when the parser stopped working met statement unnamed. #50

wants to merge 3 commits into from

Conversation

vladkens
Copy link

The CSS:

b { color: red; }
{ color: green; }
a {color: blue; }

earlier parsed to

{
    "type": "stylesheet",
    "stylesheet": {
        "rules": [
            {
                "type": "rule",
                "selectors": [
                    "b"
                ],
                "declarations": [
                    {
                        "type": "declaration",
                        "property": "color",
                        "value": "red"
                    }
                ]
            }
        ]
    }
}

now

{
    "type": "stylesheet",
    "stylesheet": {
        "rules": [
            {
                "type": "rule",
                "selectors": [
                    "b"
                ],
                "declarations": [
                    {
                        "type": "declaration",
                        "property": "color",
                        "value": "red"
                    }
                ]
            },
            {
                "type": "rule",
                "selectors": [],
                "declarations": [
                    {
                        "type": "declaration",
                        "property": "color",
                        "value": "green"
                    }
                ]
            },
            {
                "type": "rule",
                "selectors": [
                    "a"
                ],
                "declarations": [
                    {
                        "type": "declaration",
                        "property": "color",
                        "value": "blue"
                    }
                ]
            }
        ]
    }
}

@tj
Copy link
Member

tj commented Aug 27, 2013

cool, test please!

@tj
Copy link
Member

tj commented Aug 27, 2013

although we should maybe just output an error there

@vladkens
Copy link
Author

Sometimes I see in CSS such constructions. Don't think this is really critical.

@vladkens
Copy link
Author

But you decide. Maybe can and throw an exception.

@jonathanong
Copy link
Contributor

personally i'd rather throw an exception. is that even valid CSS?

eitherway, you need a rebase and squash

@ghost ghost assigned tj Nov 4, 2013
@benschwarz
Copy link

Its invalid, an exception should be thrown.

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

Successfully merging this pull request may close these issues.

4 participants