mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
genbindings: rename more go reserved words
This commit is contained in:
parent
189a93fbca
commit
5381a6b80c
@ -306,7 +306,7 @@ func parseMethod(node map[string]interface{}, mm *CppMethod) error {
|
||||
}
|
||||
|
||||
// Block reserved Go words, replace with generic parameters
|
||||
if parmName == "default" || parmName == "const" || parmName == "func" {
|
||||
if goReservedWord(parmName) {
|
||||
parmName += "Val"
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,15 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func goReservedWord(s string) bool {
|
||||
switch s {
|
||||
case "default", "const", "func", "var", "type", "len", "new", "copy", "import":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (p CppParameter) RenderTypeGo() string {
|
||||
if p.Pointer && p.ParameterType == "char" {
|
||||
return "string"
|
||||
|
Loading…
Reference in New Issue
Block a user