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

RFC: Require imports to appear before they are used #9

Closed
DanielHeath opened this issue Oct 10, 2016 · 2 comments
Closed

RFC: Require imports to appear before they are used #9

DanielHeath opened this issue Oct 10, 2016 · 2 comments

Comments

@DanielHeath
Copy link

The current spec as written requires a backtracking parser, as it does not enforce that imports appear before they are used.

Writing a backtracking parser is significantly more work than writing a single-pass parser, and this makes implementing compatible tools harder.

I propose that the spec be amended to state that :import applies from that point in the file to the end of the file and does not modify anything earlier in the file.

@TrySound
Copy link
Member

TrySound commented Jun 1, 2017

Simple string parser will be quite fast. Statements are simple to detect. Then will be replacement process by regular expression, which is still fast and simple. Doing traverse twice with postcss also not so significant in performance.

@TrySound TrySound closed this as completed Jun 1, 2017
@DanielHeath
Copy link
Author

Performance is not my argument. The point of icss as a low-level format is that different programs can be compatible with one another.

The more things the spec allows, the more opportunities there are for misunderstandings.

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

No branches or pull requests

2 participants