Support for time_t
This commit is contained in:
parent
f81b2a8989
commit
80b47c9d4e
1 changed files with 5 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
{.experimental: "codeReordering".}
|
||||||
|
|
||||||
import macros, os, strformat, strutils, tables
|
import macros, os, strformat, strutils, tables
|
||||||
|
|
||||||
import regex
|
import regex
|
||||||
|
|
@ -44,14 +46,15 @@ const gTypeMap = {
|
||||||
"unsigned char": "cuchar",
|
"unsigned char": "cuchar",
|
||||||
"unsigned short": "cushort",
|
"unsigned short": "cushort",
|
||||||
"unsigned int": "cuint",
|
"unsigned int": "cuint",
|
||||||
"unsigned long long": "culonglong"
|
"unsigned long long": "culonglong",
|
||||||
|
"time_t": "int32"
|
||||||
}.toTable()
|
}.toTable()
|
||||||
|
|
||||||
proc sanitizePath*(path: string): string =
|
proc sanitizePath*(path: string): string =
|
||||||
path.multiReplace([("\\\\", $DirSep), ("\\", $DirSep), ("//", $DirSep)])
|
path.multiReplace([("\\\\", $DirSep), ("\\", $DirSep), ("//", $DirSep)])
|
||||||
|
|
||||||
proc getIdentifier*(str: string): string =
|
proc getIdentifier*(str: string): string =
|
||||||
result = str.strip(chars={'_'}).replace(re"_+", "_")
|
result = str.strip(chars={'_'}).replace(re"_+", "_").getType()
|
||||||
|
|
||||||
if result in gReserved:
|
if result in gReserved:
|
||||||
result = &"`{result}`"
|
result = &"`{result}`"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue