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

Parse Error parsing dash in calc(-0.5 * var(ei-table-cell-padding)); #29

Closed
1 task done
vjeux opened this issue May 26, 2017 · 8 comments
Closed
1 task done

Parse Error parsing dash in calc(-0.5 * var(ei-table-cell-padding)); #29

vjeux opened this issue May 26, 2017 · 8 comments

Comments

@vjeux
Copy link

vjeux commented May 26, 2017

  • Node Version: 4.3.2
  • NPM Version: 3.10.10
  • postcss-values-parser Version: 1.2.2

This issue is regarding a problem with:

  • Standard CSS
calc(-0.5 * var(ei-table-cell-padding))
{ [ParserError: Syntax Error at line: 1, column 6] name: 'ParserError' }

Expected Behavior

Not to error on the -

Actual Behavior

Errors

How can we reproduce the behavior?

Just parse this block of code

@vjeux
Copy link
Author

vjeux commented May 26, 2017

For context, I'm running this through the entire Facebook codebase. There are only a handful of errors, I'm working on categorizing them right now :)

@vjeux
Copy link
Author

vjeux commented May 26, 2017

-moz-calc(100% - 320px)

is also throwing on the middle -

@vjeux
Copy link
Author

vjeux commented May 26, 2017

Also an issue for +: -webkit-calc(100% + 20px)

@vjeux vjeux mentioned this issue May 26, 2017
5 tasks
@shellscape
Copy link
Owner

Oof. The whole operators thing per spec was tricky to implement, and I was wondering if/when it was going to start causing other headaches. For poops and giggles, try running that with the loose: true option. If that doesn't solve it, this is going to be not fun to fix :)

@vjeux
Copy link
Author

vjeux commented May 27, 2017

Those are the only two things that are crashing and only for ~10 files out of the entire codebase, so it's definitely an edge case :)

@vjeux
Copy link
Author

vjeux commented May 27, 2017

I'll try the loose mode and report back

@vjeux
Copy link
Author

vjeux commented May 27, 2017

Omg, loose mode is working! Thanks :)

@shellscape
Copy link
Owner

Cool, that should get you by in the meantime, but that's still a bug. It's throwing on the -0.5 which should be valid there.

@shellscape shellscape reopened this May 27, 2017
vjeux added a commit to vjeux/prettier that referenced this issue May 27, 2017
vjeux added a commit to vjeux/prettier that referenced this issue May 27, 2017
vjeux added a commit to vjeux/prettier that referenced this issue May 27, 2017
vjeux added a commit to vjeux/prettier that referenced this issue May 27, 2017
vjeux added a commit to prettier/prettier that referenced this issue May 27, 2017
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