cl: conf.MacroIgnore; conf.TypeAbbr support string/[]string as abbrs (see ctx.funcName); loadEnum: support fwd decl - #886
Conversation
…funcName); loadEnum: support fwd decl
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #886 +/- ##
==========================================
- Coverage 88.51% 88.44% -0.07%
==========================================
Files 22 22
Lines 1863 1896 +33
==========================================
+ Hits 1649 1677 +28
- Misses 214 219 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Review summary
This PR adds forward-declared enum support, MacroIgnore config, multi-abbreviation TypeAbbr (map[string]any), a LongDouble basic type, and handles the UnexposedAttr cursor. The wiring through tool/config.go -> tool/gen.go -> cl.Config -> pkgCtx is consistent, the cLongDouble addition matches the existing ctypBasic table, and reusing the ctx.typdecls decl/definition split mirrors the established class.go pattern well.
A few points below are worth a look before merge. The tests could not be linked/run in the review sandbox (the llgo/libclang toolchain is unavailable), so the enum-refactor observations are static reasoning — please confirm against the existing enum golden tests.
Additional findings
cl/enum.go:40: [P3] loadEnum doc comment omits the forward-declaration path: The doc comment still says a named enum is emitted as a type "followed by a const block," describing only the definition case. After the refactor a declaration-only (forward-declared) enum emits just the named type and returns early (if !definition { return }), deferring the const block until the definition is seen. Since forward-declaration support is the point of this change, add a sentence covering that behavior so the comment matches the code.
There was a problem hiding this comment.
Review summary
This PR adds forward-declared enum support, MacroIgnore config, multi-abbreviation TypeAbbr (map[string]any), a LongDouble basic type, and handles the UnexposedAttr cursor. The wiring through tool/config.go -> tool/gen.go -> cl.Config -> pkgCtx is consistent, the cLongDouble addition matches the existing ctypBasic table, and reusing the ctx.typdecls decl/definition split mirrors the established class.go pattern well.
The inline findings below are worth a look before merge. The tests could not be linked/run in the review sandbox (the llgo/libclang toolchain is unavailable), so the enum-refactor observations are static reasoning — please confirm against the existing enum golden tests.
Additional findings
cl/enum.go:41: [P3] loadEnum doc omits the forward-declaration path: The doc comment still says a named enum is emitted as a type "followed by a const block," describing only the definition case. After the refactor a declaration-only (forward-declared) enum emits just the named type and returns early (if !definition { return }), deferring the const block until the definition is seen. Since forward-declaration support is the point of this change, add a sentence covering that behavior so the comment matches the code.
No description provided.