added comma separated imports#23
Conversation
| if s.ends_with(".css") | ||
| || s.starts_with("http://") | ||
| || s.starts_with("https://") | ||
| { | ||
| list_of_imports.push(Stmt::Import(format!("\"{}\"", s))); | ||
| } else { | ||
| list_of_imports.append(&mut self._parse_single_import(&s, span)?); | ||
| } |
There was a problem hiding this comment.
This part seemed duplicated, could split it into a function.
There was a problem hiding this comment.
Yes the code for pattern matching/parsing a single import is duplicated but it is only done duplicated once. And as the code won't be needed to be reused anywhere else I am going to keep it simple and not split it up. However can do if anyone wants it split up :)
|
Thanks for working on this! With regard to span information, that is currently a major failing of It would be nice to have tests for a heterogeneous group of imports -- that is, a comma separated import containing both plain CSS and Sass imports. A test for the output of trailing commas, e.g. |
|
Thank you! Everything looks good to me. Ideally in the future we will use a different parser for imports (rather than relying on value parsing, but still using |
|
Sweet, what would be a good area of the code to look into learning how to do that? (using a different parser than value parsing) |
Added comma seperated imports and 2 unit tests for it :)
The only thing missing maybe is that haven't worked out how to change the
spanto pick up on the change in location of the error. For example: