[bindings] Figure out in-file structs and enums before processing
authorMatt Corallo <git@bluematt.me>
Mon, 4 Jan 2021 20:52:18 +0000 (15:52 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 2 Feb 2021 22:04:31 +0000 (17:04 -0500)
commitce56152cf5dfb7cc7f63943038094d41526d6b17
treeda6b6ac41c6acc981ef266f00c6adc75a52b1e9a
parentb2bf57eb820fbe8333a5ca14f832851b9f98245c
[bindings] Figure out in-file structs and enums before processing

Previously, types which were declared and used in the same file
would fail if the use was before the declaration. This makes sense
in a few cases where a "parent" class returns a reference to a
"child" class and there's no reason we shouldn't support it.

This change adds a second pass to our file processing which gathers
the structs and enums whicha re declared in the file and adds them
to the type resolver first, before doing the real conversion.
c-bindings-gen/src/main.rs