Repository navigation
cl: compileFuncOrMethod creatorCheck use ctx.cstyleToGo; mod: github.com/llarhub/clang-c v0.9.0 #962
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
cl: compileFuncOrMethod creatorCheck use ctx.cstyleToGo; mod: github.com/llarhub/clang-c v0.9.0 #962
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,6 +137,7 @@ func compileFuncOrMethod(ctx *pkgCtx, obj *overloadObj, this *classCtx) { | |
| if creator != "" { | ||
| if newResults, ok := tryNewResults(pkgTypes, obj, results); ok { | ||
| results = newResults | ||
| creator = ctx.cstyleToGo(creator, false, true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] underscoreStart hardcoded to false diverges from other callers Every other |
||
| if mayMethod { | ||
| params, recv, typRecv, typName = tryToMethod(ctx, pkgTypes, params) | ||
| if typRecv != nil { | ||
|
|
||
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.
[P3] Co-locate creator normalization in name.go with creatorCheck
Every other Go-name derivation co-locates
cstyleToGowith its derivation incl/name.go(globalName,localName,varName,typeName,funcNameall return a ready-to-use identifier). Here the token is derived increatorCheck(name.go) but normalized infunc.go, so the caller must remember to normalize. Consider moving thiscstyleToGocall intocreatorCheck(or a smallcreatorNamehelper) so it returns an already-normalized creator, matching the established pattern and keepingfunc.gofocused on compilation logic. Non-blocking — current placement is functionally correct (it sits afterresults = newResultsand before bothfnName = creatorconsumers, and only runs whentryNewResultssucceeds).