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

Projects
None yet
2 participants
@kainosnoema
Contributor

kainosnoema commented Jan 4, 2013

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.

Allow unsuppressed comments to be compiled from nested imports
Fixes #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

Merge pull request #935 from kainosnoema/fix-imported-comments
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