Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Make cpp_expr usable without having a full PreProcessor #441

Merged
merged 15 commits into from
May 22, 2020
Merged

Conversation

jyn514
Copy link
Owner

@jyn514 jyn514 commented May 20, 2020

Replaces #440

jyn514 added 11 commits May 19, 2020 23:57
- Return Vec of replaced tokens
- Add Peekable trait to allow using any `std::iter::Peekable` iterator
- Split up file handling and preprocessing
- Make `impl Debug for InternedStr` actually useful

I was staring at a lot of debugged identifiers while working on this;
I figured they should at least be useful.

- Only perform replacement _after_ processing `defined`
- Document edge cases
- Export `replace`
- Add doc-comments about architecture
It was just there temporarily
This allows using it without having a full `PreProcessor` built
@jyn514 jyn514 added this to the Preprocessor for bindgen milestone May 20, 2020
@jyn514 jyn514 changed the title [WIP] Make cpp_expr usable without having a full PreProcessor Make cpp_expr usable without having a full PreProcessor May 20, 2020
@jyn514
Copy link
Owner Author

jyn514 commented May 20, 2020

Changes from 440: MacroReplacer is no longer a thing and replace is now a free-standing function. This has the advantage that you no longer have to passed an owned HashMap of definitions, and also makes things better for the PreProcessor by allowing it to use self.file_processor instead of self.replacer.inner everywhere.

@jyn514 jyn514 merged commit fb4dcde into master May 22, 2020
@jyn514 jyn514 deleted the cpp-expr branch May 22, 2020 02:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant