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

Fixes #444 - Allow unsuppressed comments in imports to be compiled #935

Merged
merged 1 commit into from
Jan 4, 2013

Conversation

kainosnoema
Copy link
Contributor

As mentioned in #444, imported comments are being ignored. This seems to be because imports are parsed as Block nodes, which have previously only compiled comments when properties were present. This fix adds comment compilation for Block nodes without properties as well, but only if the Block does not have scope (as is the case with an import). In order to prevent comments from existing plugins and libraries (like Nib) from being compiled, suppressed comments (without '!') are ignored.

Not sure if this is the best way to handle the problem, but it's fairly simple and seems to work well for me. I played with trying to use Root nodes for imports but ran into a lot of problems there. That said, I'd be happy to rework if there's a better way to solve this.

Fixes stylus#444

Since imports are parsed as Block nodes and Block nodes previously
only compiled comments when properties were present, imported comments
were being lost. This fix adds comment compilation for Block nodes
without properties as well, but only if the Block does not have scope
(as is the case with an import).

In order to prevent comments from existing plugins and libraries
(like Nib) from being compiled, suppressed comments (without '/*!') are ignored.
tj added a commit that referenced this pull request Jan 4, 2013
Fixes #444 - Allow unsuppressed comments in imports to be compiled
@tj tj merged commit a0044fe into stylus:master Jan 4, 2013
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

Successfully merging this pull request may close these issues.

2 participants