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

cgogen does not generate anything #3

Closed
deepakjois opened this issue Sep 22, 2016 · 3 comments
Closed

cgogen does not generate anything #3

deepakjois opened this issue Sep 22, 2016 · 3 comments

Comments

@deepakjois
Copy link

See deepakjois/harfbuzz-go@551508ac14326288e0821e5d52bd8fb71cfe06bd

The files are empty except some boilerplate code. Could you please suggest what I need to try to fix it. Do I have to include more header files in the SourcesPaths key?

@xlab
Copy link
Owner

xlab commented Sep 22, 2016

Like I suggested in comments to your commit, you should include TRANSLATOR rules that would accept all methods and types. Everything is ignored by default.

TRANSLATOR: 
  ConstRules: 
    defines: expand
  Rules: 
    global: 
      - {transform: lower}
      - {action: accept, from: "^hb_"}
      - {action: replace, from: "^hb_", to: _}
      - {transform: export}
    const:
      - {action: accept, from: "^HB_"}
      - {action: replace, from: "^hb_", to: _}
    type: 
      - {action: replace, from: "_t$"}
    private:
      - {transform: unexport}
    post-global: 
      - {action: replace, from: _$}
      - {load: snakecase}

Everything seems alright then. After that you'l' be able to specify PtrTips for the methods.
Consult the documentation for that https://github.com/xlab/cgogen/wiki/Translator-config-section.

@xlab xlab closed this as completed Sep 22, 2016
@deepakjois
Copy link
Author

Actually, I did incorporate the changes you recommended already:
https://github.com/deepakjois/harfbuzz-go/blob/master/harfbuzz.yml

Although, I must admit I don’t what those rules mean. I will read the documentation and try again.

@xlab
Copy link
Owner

xlab commented Sep 22, 2016

@deepakjois alright. I see many methods have sliced arguments where they're supposed to be pointer-like. So you can set a default ground like

- {target: ".", tips: [sref,sref,sref,sref,sref]}

And then add exceptions where actually you want slices, above that rule.

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

2 participants