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

Make the top-level API much easier to use #431

Merged
merged 1 commit into from
May 13, 2020
Merged

Make the top-level API much easier to use #431

merged 1 commit into from
May 13, 2020

Conversation

jyn514
Copy link
Owner

@jyn514 jyn514 commented May 13, 2020

  • Return Files instead of requiring it to be provided
  • Use Program struct instead of an tuple and type alias
  • Allow filename to be passed so that local includes work properly
    • This also moves filename from BinOpt to Opt

@jyn514 jyn514 requested a review from pythongirl325 May 13, 2020 13:28
@jyn514
Copy link
Owner Author

jyn514 commented May 13, 2020

For context, this is because I was reading through https://github.com/rust-lang/rust-bindgen/blob/d65100ebbaffabcc91e81ba3e88160de7cb2d5ff/src/ir/var.rs#L323 for rust-lang/rust-bindgen#1762 and noticed that the cexpr API is much nicer than what we had before. Now ours is almost as nice:

let cpp = rcc::PreProcessorBuilder::new("1 + 2").build();
// TODO: make cpp_expr() public
let expr = cpp.cpp_expr()?;

@jyn514 jyn514 merged commit cbe3948 into master May 13, 2020
@jyn514 jyn514 deleted the no-files branch May 13, 2020 21:23
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