Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to record types for callable() #2

Closed
DavisVaughan opened this issue Dec 13, 2019 · 1 comment
Closed

Need to record types for callable() #2

DavisVaughan opened this issue Dec 13, 2019 · 1 comment

Comments

@DavisVaughan
Copy link
Owner

The generated callable forward declaration is wrong for callable() lines because it assumes they all have SEXP arguments. If we record the types while parsing we can use them here to generate the correct declaration https://github.com/DavisVaughan/vctrs/blob/69f839f41975871edfd40604b71ea44938f9061a/src/init.c#L188

@DavisVaughan
Copy link
Owner Author

Maybe work in reverse for each argument. Find the first space " " from the back. Check that * is not beside the variable name, and then assume that everything else before that space is the argument type (maybe adding back in * as required). This would allow less common types to work too, like enum vctrs_enum_thing arg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant