Parse negative integers appropriately #74

Merged
merged 2 commits into from Oct 4, 2016

Projects

None yet

4 participants

@Wafflespeanut
Member

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_ints (which is required for some of the constants).

@Wafflespeanut Wafflespeanut Parse negative integers appropriately
2f13483
@Wafflespeanut
Member

It's necessary for including some constants from gfxFontConstants.h

@Wafflespeanut
Member

r? @emilio or @nox

@emilio emilio was assigned by highfive Oct 3, 2016
@emilio
Member
emilio commented Oct 4, 2016

Can you add a test for this? Adding a file under tests/headers/ and running make test should do it. Thanks!

@Wafflespeanut
Member

Alright, I've made the changes :)

@Wafflespeanut Wafflespeanut referenced this pull request in servo/servo Oct 4, 2016
Merged

Add NS_FONT_STRETCH_* consts and regenerate bindings #13566

3 of 3 tasks complete
@bors-servo bors-servo added a commit to servo/servo that referenced this pull request Oct 4, 2016
@bors-servo bors-servo Auto merge of #13566 - Wafflespeanut:consts, r=Manishearth
Add NS_FONT_STRETCH_* consts and regenerate bindings

<!-- Please describe your changes on the following line: -->

Depends on servo/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 -->
6f8bf29
@emilio
Member
emilio commented Oct 4, 2016

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?

@Wafflespeanut Wafflespeanut Add test for 'int' in whitelist_vars and regen test expectations
7a39253
@Wafflespeanut
Member

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! :)

@bors-servo
Contributor

📌 Commit 7a39253 has been approved by emilio

@bors-servo
Contributor

⚡️ Test exempted - status

@bors-servo bors-servo merged commit 7a39253 into master Oct 4, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@bors-servo bors-servo added a commit that referenced this pull request Oct 4, 2016
@bors-servo bors-servo Auto merge of #74 - servo:int, r=emilio
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).
9369a8c
@Wafflespeanut Wafflespeanut deleted the int branch Oct 4, 2016
@moz-v2v-gh moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 4, 2017
@Wafflespeanut Wafflespeanut servo: Merge #13566 - Add NS_FONT_STRETCH_* consts and regenerate bin…
…dings (from Wafflespeanut:consts); r=Manishearth

<!-- Please describe your changes on the following line: -->

Depends on servo/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
3ef014d
@xeonchen xeonchen pushed a commit to mozilla-necko/gecko that referenced this pull request Feb 4, 2017
@Wafflespeanut Wafflespeanut servo: Merge #13566 - Add NS_FONT_STRETCH_* consts and regenerate bin…
…dings (from Wafflespeanut:consts); r=Manishearth

<!-- Please describe your changes on the following line: -->

Depends on servo/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
634c8d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment