Skip to content

cl: conf.MacroIgnore; conf.TypeAbbr support string/[]string as abbrs (see ctx.funcName); loadEnum: support fwd decl - #886

Merged
xushiwei merged 2 commits into
goplus:mainfrom
xushiwei:q
Sep 30, 2026
Merged

xushiwei merged 2 commits into
goplus:mainfrom
xushiwei:q

Conversation

@xushiwei

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.02985% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.44%. Comparing base (6479608) to head (2cfd25a).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
tool/gen.go 91.66% 2 Missing ⚠️
cl/ctx.go 93.33% 1 Missing ⚠️
cl/type.go 0.00% 1 Missing ⚠️
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     
Flag Coverage Δ
llgo-tests 88.44% <94.02%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cl/ctx.go

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cl/ctx.go
Comment thread cl/enum.go
Comment thread cl/enum.go Outdated
@xushiwei xushiwei changed the title cl: conf.MacroIgnore; conf.TypeAbbr support string/[]string (see ctx.funcName); loadEnum: support fwd decl cl: conf.MacroIgnore; conf.TypeAbbr support string/[]string as abbrs (see ctx.funcName); loadEnum: support fwd decl Sep 30, 2026
@xushiwei
xushiwei merged commit 3f41e76 into goplus:main Sep 30, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant