-
Notifications
You must be signed in to change notification settings - Fork 746
Parse negative integers appropriately #74
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
Conversation
It's necessary for including some constants from |
Can you add a test for this? Adding a file under |
Alright, I've made the changes :) |
Add NS_FONT_STRETCH_* consts and regenerate bindings <!-- Please describe your changes on the following line: --> Depends on rust-lang/rust-bindgen#74 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because they're autogenerated <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Once that merges, r? @Manishearth <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13566) <!-- Reviewable:end -->
I think this is good to merge for now. IIRC upstream bindgen had integrated a C expression parser, so we might want to move to it. Can you squash, then r=me? |
I've squashed the test commits, but I'd like to keep the first commit separately, since it makes changes to the code. @bors-servo r=emilio Thanks! :) |
📌 Commit 7a39253 has been approved by |
⚡ Test exempted - status |
Parse negative integers appropriately Instead of parsing a token at some specified index, we can parse the immediately found literal. Also, this allows negative integers to be parsed as `c_int`s (which is required for some of the constants).
…dings (from Wafflespeanut:consts); r=Manishearth <!-- Please describe your changes on the following line: --> Depends on rust-lang/rust-bindgen#74 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because they're autogenerated <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Once that merges, r? @Manishearth Source-Repo: https://github.com/servo/servo Source-Revision: 6f8bf29eaf3c495cd1c0a4d3bfcccd3c50938541
…dings (from Wafflespeanut:consts); r=Manishearth <!-- Please describe your changes on the following line: --> Depends on rust-lang/rust-bindgen#74 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because they're autogenerated <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Once that merges, r? Manishearth Source-Repo: https://github.com/servo/servo Source-Revision: 6f8bf29eaf3c495cd1c0a4d3bfcccd3c50938541 UltraBlame original commit: 975b16d01ec2e1f4d2c8e5f27da13fe6d24e68bd
…dings (from Wafflespeanut:consts); r=Manishearth <!-- Please describe your changes on the following line: --> Depends on rust-lang/rust-bindgen#74 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because they're autogenerated <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Once that merges, r? Manishearth Source-Repo: https://github.com/servo/servo Source-Revision: 6f8bf29eaf3c495cd1c0a4d3bfcccd3c50938541 UltraBlame original commit: 975b16d01ec2e1f4d2c8e5f27da13fe6d24e68bd
…dings (from Wafflespeanut:consts); r=Manishearth <!-- Please describe your changes on the following line: --> Depends on rust-lang/rust-bindgen#74 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because they're autogenerated <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Once that merges, r? Manishearth Source-Repo: https://github.com/servo/servo Source-Revision: 6f8bf29eaf3c495cd1c0a4d3bfcccd3c50938541 UltraBlame original commit: 975b16d01ec2e1f4d2c8e5f27da13fe6d24e68bd
Instead of parsing a token at some specified index, we can parse the immediately found literal. Also, this allows negative integers to be parsed as
c_int
s (which is required for some of the constants).