-
Notifications
You must be signed in to change notification settings - Fork 55
Added wrapper over lookUpbindings, fixed merge conflicts, migrated code #25
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this.
We should use proper naming for the class we generate:
Clang clang; // Not called Bindings.
clang.clang_CXIndex_getGlobalOptions(...);
Or you want to go one step further, you could even think about using the prefix name replacer to remove the clang_
from the method names:
Clang clang;
clang.CXIndex_getGlobalOptions(...);
(Not for this PR, I just wanted to show that this feature is nice!)
lib/src/header_parser/parser.dart
Outdated
} | ||
|
||
/// Parses source files and adds generated bindings to [bindings]. | ||
List<Binding> parseToBindings() { | ||
final index = clang.clang_createIndex(0, 0); | ||
final index = data.bindings.clang_createIndex(0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data.bindings
-> clang
(import the name into here without a name).
clang
-> clangTypes
(change the import name).
That way both are related. Here, and everywhere else in the code.
It is kind of a pity that Dart does not have nested classes (dart-lang/language#336 and dart-lang/language#1049), as then we could have both as clang.functionCall
and Clang.Type
.
@eernstg Any other language features which might be handy in this situation?
Closes dart-lang/native#532.
A wrapper is now generated for the bindings which need to look-up symbols from dynamic library.
init-function-name
withwrapper-name
.