Document mangling
This commit is contained in:
parent
056c78020b
commit
85e6e2a240
2 changed files with 5 additions and 1 deletions
|
|
@ -13,7 +13,8 @@
|
|||
|
||||
proc mangleField(name: string): string =
|
||||
result = mangle(name)
|
||||
result[0] = result[0].toUpper
|
||||
result[0] = result[0].toUpper # Mangling makes everything lowercase,
|
||||
# but some identifiers are C keywords
|
||||
|
||||
proc isKeyword(w: PIdent): bool =
|
||||
# nimrod and C++ share some keywords
|
||||
|
|
|
|||
|
|
@ -162,6 +162,9 @@ proc makeSingleLineCString*(s: string): string =
|
|||
result.add('\"')
|
||||
|
||||
proc mangle*(name: string): string =
|
||||
## Lowercases the given name and manges any non-alphanumeric characters
|
||||
## so they are represented as `HEX____`. If the name starts with a number,
|
||||
## `N` is prepended
|
||||
result = ""
|
||||
case name[0]
|
||||
of Letters:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue